?> <div> <?php printParentBreadcrumb('', ' » ', ' » ', 30, '...'); ?> <?php echo shortenContent(printAlbumTitle(true), 30, '...'); ?> <small>( <?php if (getNumAlbums() > 0) { echo getNumAlbums() . gettext(' Subalbums, '); } ?> <?php echo getTotalImagesIn($_zp_current_album) . gettext(' Total Images'); ?> )</small> </div> </div> </div> </div> <?php if (isAlbumPage()) { ?> <div class="wrapper"> <div class="centered"> <div id="album-wrap" class="subalbums<?php if (!$zpgal_nogal) { ?>
/** * Returns the count of all the images in the album and any subalbums * * @param object $album The album whose image count you want * @return int * @since 1.1.4 */ function getTotalImagesIn($album) { global $_zp_gallery; $sum = $album->getNumImages(); $subalbums = $album->getAlbums(0); while (count($subalbums) > 0) { $albumname = array_pop($subalbums); $album = newAlbum($albumname); $sum = $sum + getTotalImagesIn($album); } return $sum; }
/** * Returns the count of all the images in the album and any subalbums * * @param object $album The album whose image count you want * @return int * @since 1.1.4 */ function getTotalImagesIn($album) { global $_zp_gallery, $_zp_albums_visited_getTotalImagesIn; $_zp_albums_visited_getTotalImagesIn[] = $album->name; $sum = $album->getNumImages(); $subalbums = $album->getAlbums(0); while (count($subalbums) > 0) { $albumname = array_pop($subalbums); if (!in_array($albumname, $_zp_albums_visited_getTotalImagesIn)) { $album = newAlbum($albumname); $sum = $sum + getTotalImagesIn($album); } } return $sum; }