Créer un champs accés

More
10 years 7 months ago #46481 by bootpass
bonjour

je voudrez créer un champs ou l'utilisateur final peux choisir parmis certain accès de visibilité de son article

merci

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

More
10 years 7 months ago #46483 by ggppdk
Replied by ggppdk on topic Créer un champs accés
Hello

-- the visibility of the field is controlled at field configuation only


-- but you can simulate the desirable behaviour by creating 2 fields

a. create a field e.g. with id '54' of type 'select':
1::Public %%
2::Registered %%
3::Special %%


b. your field with name 'myfieldname44' that you want user to select to be hidden or visible


c. then your editor will select via field 54 the ACCESS level (visibility of 'myfieldname44')


d. in your item.php or in category_items.php:

Code:
$fvals = $items->fieldvalues[$field_id]; $v = @fvals[0]; $v = ( @unserialize($v)!== false || $v=== 'b:0;' ) ? unserialize($v) : $v; // BETTER place next 2 lines outside the item loop at the top of the PHP file $user = JFactory::getUser(); $aid_arr = $user->getAuthorisedViewLevels(); if (in_array($v, $aid_arr)) { echo FlexicontentFields::getFieldDisplay($item, 'myfieldname44'); }

I may have some PHP syntax error above, please correct it

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...

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

More
10 years 7 months ago #46485 by micker
Replied by micker on topic Créer un champs accés
i am waiting your return an if its good doing a item faq !
great ressource

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.474 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