ZenphotoCMS Forum
Only Show Link to Album Download (.zip) if Logged In as Registered User? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: Themes (https://forum.zenphoto.org/forum-5.html)
+--- Thread: Only Show Link to Album Download (.zip) if Logged In as Registered User? (/thread-6180.html)



Only Show Link to Album Download (.zip) if Logged In as Registered User? - SendDerek - 24-11-2009

Hello.

I've spun my wheels on this for a bit now. I didn't really get far. I'm hoping that I might be able to get a bit of assistance.

I would like to simply display the "Download a zip file of this album" link to those who are logged in as a registered user (like family and friends), and not to those who are simply browsing. Something like:

if (registeredUser())
printAlbumZip();

It seems that using the following has no effect on whether or not I'm actually logged in (it always displays the link):

After reading more in the documentation, it looks like that checkForPassword() function looks to see if a registration form is present.
http://www.zenphoto.org/documentation/functions/_template-functions.php.html

Maybe isMyAlbum() is more appropriate? Not sure.

I appreciate any feedback I get. Thanks in advance.




Only Show Link to Album Download (.zip) if Logged In as Registered User? - micheall - 24-11-2009

you are correct, isMyAlbum() would be a call you could use. Documentation says "Checks to see if the loggedin Admin has rights to the album". So what you could set it so a certain class of users has rights to the album.

Then you'd use the
if(isMyAlbum()){ printAlbumZip(); }




Only Show Link to Album Download (.zip) if Logged In as Registered User? - acrylian - 24-11-2009

If you want to check for a general loggedin user you could also try if(zp_loggedin()) { ... } You can also set tspecific rights like if(zp_loggedin(ADMIN_RIGHTS | ZENPAGE_RIGHTS)) { ...}




Only Show Link to Album Download (.zip) if Logged In as Registered User? - SendDerek - 24-11-2009

Thanks guys. That's exactly the sorta push I was looking for. I'm going to give the suggestions a whirl when I get home tonight.

I appreciate it!