/**
 *
 * used to get a list of albums to be further processed
 * @param object $obj from whence to get the albums
 * @param array $albumlist collects the list
 */
function getImageAlbumAlbumList($obj, &$albumlist)
{
    global $_zp_gallery;
    $hint = $show = false;
    $locallist = $obj->getAlbums();
    foreach ($locallist as $folder) {
        $album = new Album($_zp_gallery, $folder);
        if (!$album->isDynamic() && $album->checkAccess($hint, $show)) {
            $albumlist[] = $album->getID();
            getImageAlbumAlbumList($album, $albumlist);
        }
    }
}
/**
 * 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;
}
Exemple #3
0
 /**
  * Gets an array of the album ids of all accessible albums (publich or user dependend)
  *
  * @param object $obj from whence to get the albums
  * @param array $albumlist collects the list
  */
 protected function getAllAccessibleAlbums($obj, &$albumlist)
 {
     $locallist = $obj->getAlbums();
     foreach ($locallist as $folder) {
         $album = newAlbum($folder);
         if (!$album->isDynamic() && $album->checkAccess()) {
             $albumlist[] = $album->getID();
             self::getAllAccessibleAlbums($album, $albumlist);
         }
     }
 }
/**
 *
 * Enter description here ...
 * @param object $obj the starting point
 * @param array $albumlist the container for the results
 * @param string $gateway name of validation function
 */
function getSitemapAlbumList($obj, &$albumlist, $gateway)
{
    global $_zp_gallery;
    $locallist = $obj->getAlbums();
    foreach ($locallist as $folder) {
        $album = newAlbum($folder);
        if ($album->getShow() && $gateway($album)) {
            $albumlist[] = array('folder' => $album->name, 'date' => $album->getDateTime(), 'title' => $album->getTitle());
            if (!$album->isDynamic()) {
                getSitemapAlbumList($album, $albumlist, $gateway);
            }
        }
    }
}
/**
 * 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;
}