Jump to content

If Is Admin = Show Something - Is it possible?


criat

Recommended Posts

Thanks cesium, saw that but only works if admin X is logged in, I'm looking for a variable that works for any admin

I think the last block of code from cesiumdeth's link is actually what you're looking for...

 

{if $smarty.session.adminid}

forget the bit about admin X being logged in, logically I would assume the session variable only exists if anyone is logged in as an admin - so this should be sufficient for your needs...

 

if you wanted only a certain admin(s) to see something (e.g admin X), then I guess you could expand the code to be more specific...

 

{if $smarty.session.adminid eq "1"}
do this...
{/if}

but in your case, {if $smarty.session.adminid} should be all that you need.

Link to comment
Share on other sites

  • 6 years later...
On 1/7/2014 at 5:51 PM, brian! said:

I think the last block of code from cesiumdeth's link is actually what you're looking for...

 

 


{if $smarty.session.adminid}
 

 

forget the bit about admin X being logged in, logically I would assume the session variable only exists if anyone is logged in as an admin - so this should be sufficient for your needs...

 

if you wanted only a certain admin(s) to see something (e.g admin X), then I guess you could expand the code to be more specific...

 

 


{if $smarty.session.adminid eq "1"}
do this...
{/if}
 

 

but in your case, {if $smarty.session.adminid} should be all that you need.

how can i use $smarty variable in custom php page?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated