Member
Member
SendDerek   2009-11-24, 05:54
#1
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):
<?php if (!checkForPassword()) { ?>
<?php printAlbumZip(); }?>

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.
Member
Member
micheall   2009-11-24, 09:36
#2
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();
}
`
Administrator
Administrator
acrylian   2009-11-24, 10:14
#3
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)) { ...}`
Member
Member
SendDerek   2009-11-24, 17:33
#4
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!
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.