function loadAlbum($album)
{
    global $gallery, $_zp_current_album, $_zp_current_image;
    $subalbums = $album->getSubAlbums();
    $count = 0;
    foreach ($subalbums as $folder) {
        $subalbum = new Album($gallery, $folder);
        $count = $count + loadAlbum($subalbum);
    }
    $_zp_current_album = $album;
    if (getNumImages() > 0) {
        echo "<br />" . $album->name . "{";
        while (next_image(true)) {
            if (isImagePhoto($_zp_current_image)) {
                echo '<img src="' . getImageThumb() . '" height="8" width="8" /> | <img src="' . getDefaultSizedImage() . '" height="20" width="20" />' . "\n";
            } else {
                echo '<img src="' . getImageThumb() . '" height="8" width="8" /> | ';
            }
            $count++;
        }
        echo "}<br/>\n";
    }
    return $count;
}
예제 #2
0
function loadAlbum($album)
{
    global $gallery, $_zp_current_album, $_zp_current_image;
    $subalbums = $album->getAlbums();
    $started = false;
    $tcount = $count = 0;
    foreach ($subalbums as $folder) {
        $subalbum = new Album($gallery, $folder);
        if (!$subalbum->isDynamic()) {
            $tcount = $tcount + loadAlbum($subalbum);
        }
    }
    $theme = $gallery->getCurrentTheme();
    $id = 0;
    $parent = getUrAlbum($album);
    $albumtheme = $parent->getAlbumTheme();
    if (!empty($albumtheme)) {
        $theme = $albumtheme;
        $id = $parent->id;
    }
    loadLocalOptions($id, $theme);
    $_zp_current_album = $album;
    if ($album->getNumImages() > 0) {
        echo "<br />" . $album->name . ' ';
        while (next_image(true)) {
            $thumb = getImageThumb();
            if (strpos($thumb, 'i.php?') === false) {
                $thumb = NULL;
            }
            if (isImagePhoto($_zp_current_image)) {
                $image = getDefaultSizedImage();
                if (strpos($image, 'i.php?') === false) {
                    $image = NULL;
                }
            } else {
                $image = NULL;
                if ($_zp_current_image->objectsThumb == NULL) {
                    $thumb = NULL;
                }
            }
            if (!empty($thumb) || !empty($image)) {
                if (!$count) {
                    $started = true;
                    echo "{ ";
                } else {
                    echo ' | ';
                }
            }
            if (!empty($thumb)) {
                echo '<img src="' . $thumb . '" height="8" width="8" /> ';
            }
            if (!empty($image)) {
                echo ' <img src="' . $image . '" height="20" width="20" />';
            }
            if (!empty($thumb) || !empty($image)) {
                echo "\n";
            }
            $count++;
        }
        if ($started) {
            echo ' } ';
        }
        printf(ngettext('[%u image]', '[%u images]', $count), $count);
        echo "<br />\n";
    }
    return $count + $tcount;
}
예제 #3
0
function loadAlbum($album)
{
    global $_zp_current_album, $_zp_current_image, $_zp_gallery, $custom, $enabled;
    $subalbums = $album->getAlbums();
    $started = false;
    $tcount = $count = 0;
    foreach ($subalbums as $folder) {
        $subalbum = newAlbum($folder);
        if (!$subalbum->isDynamic()) {
            $tcount = $tcount + loadAlbum($subalbum);
        }
    }
    $theme = $_zp_gallery->getCurrentTheme();
    $id = 0;
    $parent = getUrAlbum($album);
    $albumtheme = $parent->getAlbumTheme();
    if (!empty($albumtheme)) {
        $theme = $albumtheme;
        $id = $parent->getID();
    }
    loadLocalOptions($id, $theme);
    $_zp_current_album = $album;
    if ($album->getNumImages() > 0) {
        echo "<br />" . $album->name . ' ';
        while (next_image(true)) {
            if (isImagePhoto($_zp_current_image)) {
                $countit = 0;
                if (in_array('*', $enabled)) {
                    $uri = getFullImageURL(NULL, 'Protected view');
                    if (strpos($uri, 'full-image.php?') !== false) {
                        if (!($count + $countit)) {
                            echo "{ ";
                        } else {
                            echo ' | ';
                        }
                        $countit = 1;
                        ?>
						<a href="<?php 
                        echo html_encode($uri);
                        ?>
&amp;debug">
							<?php 
                        echo '<img src="' . html_encode(pathurlencode($uri)) . '" height="30" width="30" alt="X" />' . "\n";
                        ?>
						</a>
						<?php 
                    }
                }
                foreach ($custom as $key => $cacheimage) {
                    if (in_array($key, $enabled)) {
                        $size = isset($cacheimage['image_size']) ? $cacheimage['image_size'] : NULL;
                        $width = isset($cacheimage['image_width']) ? $cacheimage['image_width'] : NULL;
                        $height = isset($cacheimage['image_height']) ? $cacheimage['image_height'] : NULL;
                        $thumbstandin = isset($cacheimage['thumb']) ? $cacheimage['thumb'] : NULL;
                        if ($special = $thumbstandin === true) {
                            list($special, $cw, $ch, $cx, $cy) = $_zp_current_image->getThumbCropping($size, $width, $height);
                        }
                        if (!$special) {
                            $cw = isset($cacheimage['crop_width']) ? $cacheimage['crop_width'] : NULL;
                            $ch = isset($cacheimage['crop_height']) ? $cacheimage['crop_height'] : NULL;
                            $cx = isset($cacheimage['crop_x']) ? $cacheimage['crop_x'] : NULL;
                            $cy = isset($cacheimage['crop_y']) ? $cacheimage['crop_y'] : NULL;
                        }
                        $effects = isset($cacheimage['gray']) ? $cacheimage['gray'] : NULL;
                        if (isset($cacheimage['wmk'])) {
                            $passedWM = $cacheimage['wmk'];
                        } else {
                            if ($thumbstandin) {
                                $passedWM = getWatermarkParam($_zp_current_image, WATERMARK_THUMB);
                            } else {
                                $passedWM = getWatermarkParam($_zp_current_image, WATERMARK_IMAGE);
                            }
                        }
                        if (isset($cacheimage['maxspace'])) {
                            getMaxSpaceContainer($width, $height, $_zp_current_image, $thumbstandin);
                        }
                        $args = array($size, $width, $height, $cw, $ch, $cx, $cy, NULL, $thumbstandin, NULL, $thumbstandin, $passedWM, NULL, $effects);
                        $args = getImageParameters($args, $album->name);
                        $uri = getImageURI($args, $album->name, $_zp_current_image->filename, $_zp_current_image->filemtime);
                        if (strpos($uri, 'i.php?') !== false) {
                            if (!($count + $countit)) {
                                echo "{ ";
                            } else {
                                echo ' | ';
                            }
                            $countit = 1;
                            ?>
							<a href="<?php 
                            echo html_encode($uri);
                            ?>
&amp;debug">
								<?php 
                            if ($thumbstandin) {
                                echo '<img src="' . html_encode(pathurlencode($uri)) . '" height="15" width="15" alt="x" />' . "\n";
                            } else {
                                echo '<img src="' . html_encode(pathurlencode($uri)) . '" height="20" width="20" alt="X" />' . "\n";
                            }
                            ?>
							</a>
							<?php 
                        }
                    }
                }
                $count = $count + $countit;
            }
        }
        if ($count) {
            echo '
						} ';
        }
        printf(ngettext('[%u image]', '[%u images]', $count), $count);
        echo "<br />\n";
    }
    return $count + $tcount;
}
예제 #4
0
             //echo " ne correspond pas au genre demandé";
         }
     }
     echo "suppression des albums";
     break;
 case 'loadGenre':
     //supprime la playlist et ajoute tous les albums correspondant au genre indiqué -> exemple: $parameter=Rock ->ok
     $mySqueezeCLI = new SqueezeCLI(loadGenre($parameter));
     break;
 case 'addAlbum':
     //ajoute l'album indiqué en paramètre a la fin de la playlist -> exemple :addAlbum_8 Mile ->ok
     addAlbum($parameter);
     break;
 case 'loadAlbum':
     //supprime la playlist et ajoute l'album indiqué en paramètre -> exemple: loadAlbum_8 Mile ->ok
     $mySqueezeCLI = new SqueezeCLI(loadAlbum($parameter));
     break;
 case 'addTitle':
     //ajoute le titre en paramètre a la fin de la playlist -> exemple :addTitle_02 No Woman No Cry.mp3 ->ok
     $mySqueezeCLI = new SqueezeCLI(addTitle($parameter));
     break;
 case 'loadTitle':
     //supprime la playlist, ajoute le titre en paramètre ->  exemple :loadTitle_02 No Woman No Cry.mp3 ->ok
     $mySqueezeCLI = new SqueezeCLI(addTitle($parameter));
     break;
 case 'deleteTitle':
     //retire un titre de la playlist, attention ici il s'agit des ID de l'index, 0 étant le titre en cour de la playlist-> exemple : deleteTitle_1 ->ok
     deleteTitle($parameter);
     echo "titre supprimé \n";
     break;
 case 'getPlaylist':