An 'is_admin' function ?

Hello,

Does an 'is-admin' function (like in WordPress) exist in Zenphoto ?

I have a button for copying the image path in clipboard, but I want to display it only for me, not for visitors.

Comments

  • acrylian Administrator, Developer
    You could use `if(($_zp_loggedin & ADMIN_RIGHTS)) { }`
  • Perfect!!
    Many thanks for this very fast solution...
  • More precicely, `if (zp_loggedin())` will tell you if the viewer is logged in as an admin. acrylian' code is more precice on what kind of administrator is logged in. Most of the time it is not improtant what the admin's rights are so `zp_loggedin()` is appropriate. Also, it works anywhere. If you use `if(($_zp_loggedin & ADMIN_RIGHTS)) ` within a function you will need to declare `global $_zp_loggedin;`
  • acrylian Administrator, Developer
    I actually copied too quickly the wrong thing...
  • Thanks for this detail, sbillard !
Sign In or Register to comment.