J! basic :J acess

More
14 years 4 months ago #2601 by Jay
J! basic :J acess was created by Jay
Hi i would like to have a simple code to display only to admin users, how do i do that.?

i am aware that FC has this feature and i m using it now with no issue, but i would like to know j! standard codes.

tks.

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

More
14 years 4 months ago #2603 by vistamedia
Replied by vistamedia on topic J! basic :J acess
Hi Jay,
I sorry but I don't understand your question. Does it concerns frontend or backend?
Cheers,
Emmanuel.

FLEXIcontent lead developer.
www.vistamedia.fr web agency and custom development.
www.joomla.fr co-administrator.
Please no PM for support request, use the forum for that!!!

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

More
14 years 4 months ago #2607 by Jay
Replied by Jay on topic J! basic :J acess
Hi,

a situation where i need to allow certain user name to view certain part of the site.example user id:7 .

in field settings i know that its either registered,public,admin etc.

i want to allow single user id 7 to view that section only.

i know this need to be hardcoded.can u share the code or guide.? tks

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

More
14 years 4 months ago #2608 by Linuus
Replied by Linuus on topic J! basic :J acess
I guess you can use this to get the logged in users' ID
Code:
$user =& JUser::getInstance($id);

More info: api.joomla.org/Joomla-Framework/User/JUser.html

It has nothing to do with Flexi though ;)

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

More
14 years 4 months ago #2611 by Jay
Replied by Jay on topic J! basic :J acess
Hi Linuus .

yes.its basic j!.nothing got to do with fc but i would like this function to be inmy fc template/

can u share the complete code on how to allow only user id of 7 to view certain part of the template?

example

$user =& JUser::getInstance($id);
if $user ==7 ;
<div clas="userid7"></div>
else
..

thank you very much.

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

More
14 years 4 months ago #2612 by Linuus
Replied by Linuus on topic J! basic :J acess
Something like this?
Code:
$user =& JUser::getInstance($id); if ($user ==7){ echo '<div class="userid7"></div>'; }else{ echo 'Not user 7'; }

Maybe? Haven't tried it myself, ever :P

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

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