Albums with subalbums at index

Hi everyone,
I'm making my own theme and have a little trouble with displaing Album and then subalbums on index.php. It should look (in function way) like this:http://flowplayer.org/tools/demos/scrollable/site-navigation.html . Albums won't change so they can by coded straight into the page (<img src="thumb"/>). But then I need to display albums that belong to that particular album.
Is there any way to do that by setting to album loop something like - get albums from http://localhost:8888/webportfolium/index.php?album=albumname ?
I could do that by including frame from album page, but i really don't like this way.
Thanks for every hint.

Comments

  • acrylian Administrator, Developer
    You will have to use the album class object methods directly like this one:
    http://www.zenphoto.org/documentation/classes/Album.html#methodgetSubAlbums

    You will also need some image class methods and in general some PHP knowledge about object orientation.

    Please see the documentation on details about the available methods.
  • I really appreciate your work and I'm glad for your help. I spent last three days by studying OOP in PHP and PHP in general. I also had some basic knowledge before. But I'm completely lost.

    Could you please give me some basic hint from where to start? Just give me a bit closer direction where to go. I understand you have better things to do.

    Thanks
  • acrylian Administrator, Developer
    Ok, here is a basic hint. Zenphoto stores current objects in global variables. For the albums the global `$_zp_current_album` is available within the `next_album` loop (it is also on the album page and the image page). You can get the subalbums of the current album in the loop by using ``$_zp_current_album->getSubAlbums()`. This returns an array of the album names. You can now use this to create an album object of each of those and then get the names of the images of each. And so on.

    Take a look at the class methods on the documentation.
  • Was quite desperate about it. Couldn't find the way. I just found that I'm better in searching then coding, so after a while of searching I found the solution. Just want to post it here in case anyone would have the same problem as I had.

    The answer is here: http://www.zenphoto.org/support/topic.php?id=4143#post-24729

    Just ad this code inside the album loop:
    `

    <?php<br />
    $subalbums = $_zp_current_album->getSubalbums();

    foreach ($subalbums as $subalbum) {

    $subalbumobj = new Album($_zp_gallery,$subalbum);

    echo "imagegetAlbumThumb()."' />
    ";

    }

    ?>

    `
Sign In or Register to comment.