counting subalbum images

I want to have the following line below the album title:

Total images: xx in xx subalbums

I know the function getNumImages. This is fine if there are no subalbums.
is there a function that counts the subalbums and the images in those subalbums?

Comments

  • `getTotalImagesIn($album)`

    The functions are all documented in our User Guide. Most of the ones of interest will be in the template-fuinctions.php documentation--http://www.zenphoto.org/documentation/zenphoto/_template-functions.php.html
  • Thanks! Thats one quick response :)
    I have looked in the documentation, but failed to recognize the template-functions.php

    This will do the trick :))
  • Ok, for some reason it fails on me.

    I have the following code that gave me imagecount without sub and the subalbumcount:

    `<?php $countimgs = getNumImages(); if ($countimgs > 1 || $countimgs == 0) $countimgs .= " images"; else $countimgs .=" image"; echo$countimgs; ?> | <? $countsuba = getNumSubalbums(); if ($countsuba > 1 || $countsuba == 0) $countsuba .= " subalbums"; else $countsuba .=" subalbum"; echo $countsuba; ?>`

    I tried to replace getNumImages() for getTotalImagesIn($album), didnt work, the site stopped showing after the first album thumb.

    I tried to get the albumId and put that in $album, same not working result.

    How do i get the correct $album ??

    I forgot to say that this is for the index page, so that i am not yet in a album.
  • Is it the album who's thumbnail is being displayed on the index page? Then use `$_zp_current_album`.
  • You are great! This works perfect now.
Sign In or Register to comment.