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

More
11 years 11 months ago - 11 years 11 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: 11 years 11 months ago by walkyripa.

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

More
11 years 11 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...

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

More
11 years 11 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
11 years 11 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...

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

More
11 years 11 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é!
Attachments:

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

More
11 years 11 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...

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.759 seconds
Save
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