[Solved] Un lien "connectez-vous pour lire la suite"....?

More
13 years 2 months ago - 13 years 2 months ago #31611 by walkyripa
Bonjour,

Voici mon besoin, je suis à la recherche de toute idée m'aidant à y parvenir :

J'affiche sur une page le sommaire (c'est à dire titres de rubriques et premières lignes) d'une revue.
Certaines rubriques sont publiques, d'autres privées.
Je voudrais que l'intro des rubriques soit visible de tous, mais que :
    Si le visiteur est non enregistré, il ait un lien "connectez-vous pour lire la suite",
    Si le visiteur est enregistré, il ait un lien "lire la suite".

Je sais vérifier si l'utilisateur est enregistré ou non. Par contre, que me conseillez-vous pour le reste :
    Puis-je faire ça en créant des champs pour chaque rubrique (me semble difficile, les text-area de FC ne gérant pas les liens lire la suite --> Une alternative au lien lire la suite?)
    S'il faut créer un article par rubrique, comment rendre l'intro public et le reste privé quand nécessaire?

Merci pour n'importe quel conseil qui pourrait m'aider!

Merci à la communauté!
Last edit: 13 years 2 months ago by walkyripa.

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #31618 by ggppdk
Category and other views can display unauthorized items,

you can use inside category items ...
Code:
<?php if ( JFactory->getUser()->id ) { echo JText::_("Logged_Read_More"); } else { echo JText::_("Unlogged_Read_More"); } ?>


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #31627 by walkyripa
Thank you for your answer... i activate in general configuration "show unauthorized links" to yes. So i can display title and intro text in category view : great.

Just because you go fast, there are some wrong or missing letters, if i'm correct, it must be :
Code:
<?php if ( JFactory::getUser()->id ) { echo JText::_("Logged_Read_More"); } else { echo JText::_("Unlogged_Read_More"); } ?>

What i can't do is catching if the item is authorized or not, in order to have, for example if the user is not logged in :

item1(public) - intro 1 - "click to read more"
item2 (private) - Intro 1 - "login to read more".

in red is what i can't achieve...

thank you, one more time (but i'm about to solve all :) )

Merci à la communauté!

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #31631 by ggppdk
yes

i mean you could put

Unlogged_Read_More="Read more (may require login)"

but it makes sense (i think it is possible, to add a FLAG to indicate if item is not authorized)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #31634 by walkyripa
Hum, i think i'm not clear :

I know how to verify if the user is logged in, or not. No problem for that.

What i don't know, is how to verify if an article is public or not! (what i called : unauthorized content, but maybe i'm wrong).

In fact, it's very similar to my question concerning the search result (<!-- l --><a class="postlink-local" href=" flexicontent.org/phpbb/viewtopic.php?f=9&t=5528#p31619 ">viewtopic.php?f=9&t=5528#p31619).

perhaps a picture is more clear : here is what i want to do :

[attachment=0:166hlweg]<!-- ia0 -->3.jpeg<!-- ia0 -->[/attachment:166hlweg]

Merci à la communauté!

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #31641 by ggppdk
Yes, i just meant that the solution does not involve that anyway to check if user can display/view the item :
Code:
// Calculate read access ... if (FLEXI_J16GE) { $groups = JFactory::getUser()->getAuthorisedViewLevels(); $canviewitem = in_array($items[$i]->access, $groups); } else if ($user->gid >= 25) { $canviewitem = true; } else { $aid = (int) JFactory::getUser()->get('aid'); $canviewitem = FLEXI_ACCESS ? FAccess::checkAllItemReadAccess('com_content', 'read', 'users', $user->gmid, 'item', $items[$i]->id) : $item[$i]->access <= $aid; }

NOTE above for J1.6+ the access for item main category should also be checked:
$item[$i]->catid
above code does not do that


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #31692 by walkyripa
Yeeees! great! It works, thank you!

(i just replace $item[$i] with $items[$i] in my template code).

Merci à la communauté!

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #31703 by ggppdk
Ok, thanks for feedback,
corrected '$item[]' to '$items[]' above

-- NOTE: the above code will work without any further modifications if all your categories have public ACCESS Level, if they do not, then the above code must be changed to check access of category too


-- Also this component (free) involves a huge effort from FLEXIcontent team,

please consider leaving a review at JED (joomla extensions site)

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #31705 by walkyripa
Yes, i'm quiet at the end of my development, and i'm really delighted with Flexicontent. I just now had a comment on the JED.
But please change your flexicontent description : for now it display only the J1.5 compatibility!!!

To stay on this subject (i already said that in an other topic, but i think it's really important) : Personnaly, i found that demo component, with admin access are very very usefull in order to :

Show how powerful is component,
limit forum questions to interesting ones, as major questions have an answer on demo backend.

(There is a way to automaticaly refresh the demo website to your parameters, i think that Akeeba provide this tool).

Thank you one more time!

Merci à la communauté!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save