Several things.
first, you should be using the function `zp_loggedin()` rather than the global variable.
second, this result will never be exactly true, but testing it with `if (zp_loggenin()) {` will tell you if there is an admin user logged in.
third, there are album rights, etc. for admin users, so if you want to know if an admin is logged in with rights to view the album, that is yet another story.
fourth, visitors can also log in and view the gallery. If you are interested in that, then you have yet another story. for this look at the `checkForPassword()` function.