Only Show Link to Album Download (.zip) if Logged In as Registered User?

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.

Comments

  • 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();
    }
    `
  • acrylian Administrator, Developer
    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)) { ...}`
  • 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!
Sign In or Register to comment.