Way to target individual album in code?

Still fine-tuning ZP integration into site. Anyone know if there is a way to modify the code in album.php so that it only addresses a single album, instead of running through the whole list of albums? Here's the code in question. It just runs through the entire list of existing albums and constructs the thumbs and descriptions. I want to have it do that for just a single album that I designate. The the whole block of album.php code could be copied into an existing html page to output a single album's thumbs and links.

<div id="albums">
<?php while (next_album()): ?> /*here's where it runs through the album list */
<div class="album">
<div class="thumb">
" title="View album: <?php echo getAlbumTitle();?>"><?php printAlbumThumbImage(getAlbumTitle()); ?>
</div>

etc etc etc

Comments

  • acrylian Administrator, Developer
    What exactly do you mean? If you want to show the thumbnails of the images in one specific album, link directly to that album.

    But if you want only on album thumb and its album description, the easiest would be to have top level albums with one subalbum each. If you then link directly into that top level album, only one album would appear.
  • os07 Member
    Yes - to have just ONE albums' thumbnails appear somewhere in an html page.

    I can figure out how to put on an html page the regular album link with the one representative thumbnail, which, when you click on it, leads to the display of all of a single album's thumbnails/links.

    I want to skip that step, and just have the album's whole group of thumbnails/links to full images, appear on an html page.
  • os07 Member
    Well, I guess maybe I didn't make myself all that clear.

    I want to have one album and its thumbnails appear on one of my html pages. I tried the technique below I found in a thread here, and it works fine - but it shows the thumbs from ALL albums on the page. I want to limit the display to just ONE album's thumbnails. Please excuse my lack of PHP experience.

    <?php while (next_album()): ?>
    <?php printAlbumTitle();?><br>
    <?php $album = query_single_row("SELECT folder from". prefix('albums')." WHERE id = ".getAlbumID());
    $images = $_zp_current_album->getImages();
    foreach($images as $image) {
    echo "";
    echo "<img src='".WEBPATH."/".ZENFOLDER."/i.php?a=".$album['folder']."&i=".$image."&h=50&w=50&t' />";echo "
    "; }?>

    Is there a way to choose a SINGLE album or to restrict the number of albums/thumbnails that is displayed?
  • acrylian Administrator, Developer
    We already talked about that on the other thread, didn't we? Link directly into that album you want to display and you get only the thumbnails of that album. Otherwise I probably don't understand what you are trying to do.
  • os07 Member
    It's the linking directly into one album that I don't understand.
  • acrylian Administrator, Developer
    You will have a kind of navigation on your site, don't you? Then simply use a link `zenphoto/`and the album page will show only the thumbnails in that album.
  • os07 Member
    THANK YOU! This is obviously a case of my not grasping how the ZP system works. It's much clearer to me now. Your patience and help are both big parts of why ZP is such a great program!

    One issue: alongside my album thumbs is the PHP error message:

    Fatal error: Call to a member function getSubalbums() on a non-object in /home/yoursite/www/www/yourgallery/zenphoto/zp-core/template-functions.php on line 307

    I tried to purge the cache and to refresh the db, but the error still persists. I think it is related to the fact that I had a subalbum and then deleted it.
  • acrylian Administrator, Developer
    Maybe something of one of your experimental code is left where it shouldn't be. I suggest starting new with a standard theme.
Sign In or Register to comment.