Thanks. I already looked in the user guide (that is how I found the template-functions.php name), but I haven't been able to find a simple function that returns a true or false if the album is permitted for the current user.
The section from the user guide on themes that is relevant doesn't address how to filter the albums. (See below). Actually, the problem would be solved easier if the list of returned albums was pre-filtered based on the user's ability to see the albums. Don't return what they can't see and problem solved. But I am sure I'd be too far down the rabbit hole to make that happen.
Am I basically asking for a feature in ZenPhoto that would be a checkbox by user or group that would say 'hide albums that are not protected'??
----------------------------------------------------------------------------------
The following code is the main chunk of code for this file. It’s the so called “album loop†that lists all the albums in the gallery:
<?php while (next_album()): ?> <div class="album">
<div class="albumthumb"><a>"
title="<?php echo getAlbumTitle();?>">
<?php printAlbumThumbImage(getAlbumTitle()); ?></a></div>
<div class="albumtitle">
<a>"
title="<?php echo getAlbumTitle();?>"></a>
<?php printAlbumTitle(true); ?></div> </div> <?php endwhile; ?>
Let’s take this line by line. First you’re starting a while loop in PHP and tell ZenPhoto that ‘as long as there’s a another album that’s next in the list of albums, do the following code’. The ‘code’ that you want Zenphoto to process for every album is placed in between the the lines '<?php while (next_album()): ?>' and '<?php endwhile; ?>'
That is why when you look at the xHTML source from your browser you see a div with an album class more than once, because it will put every album into a div tag with the album class.
Now inside that while loop you will see more PHP code. The functions getAlbumLinkURL(), getAlbumTitle(), printAlbumThumbImage(), and printAlbumTitle() are all theme functions of which we won’t explain because there are just too many to create a list here and you can also look them up in the theme function reference. However it’s pretty obvious what they do just by looking at the function names. Keep in mind that all these functions provide information about the album and this information will be repeated for each album in the list of albums while going through the while loop.
Note: If you password protect an album via the admin backend and have the image display use lock image option set, Zenphoto uses a default image err-passwordprotected.gif as a replacement for the actual album thumb. This image is located within /zenphoto/zp-core/image/ folder. But a theme can have its own image, all that needs to be done is to place a custom image of the same name like this: /zenphoto/<themefolder>/images/err-passwordprotected.gif.