In Zenphoto terminology (see http://www.zenphoto.org/2008/08/zenphoto-glossary/) "gallery" is the entire Zenphoto installation. If you just mean albums within an album (=subalbums) that is a standard feature.
<?php } if (!$first) { echo "\n\n</div>\n"; } ?> ` So if you have a structure like this in your "albums" folder:
- albums -- folder with 5 pictures -- folder with 2 subfolders --- subfolder 1 with 20 pictures --- subfolder 2 with 30 pictures -- folder with 20 pictures -- etc.
It will display something like this under a folder containg pictures
"Foldername" ( 5 photos)
and under a folder containing subfolders:
"Foldername" ( 2 album)
This is great!
Only thing.... if a folder contains videos it still print "xx photos"
Maybe some coder here is able to add something to this code so it will recognise videofiles and print out "video" instead, then it would be perfect.
Comments
`
<?php
$anumber = getNumSubalbums();
$inumber = getNumImages();
if ($anumber > 0 || $inumber > 0) {
echo '
(';
<?phpif ($anumber == 0 && $inumber == 1) {
printf(gettext('1 photo'));
} else if ($anumber == 0 && $inumber > 1) {
printf(gettext('%u photos'), $inumber);
} else if ($anumber == 1 && $inumber == 1) {
printf(gettext('1 album, 1 photo'));
} else if ($anumber > 1 && $inumber == 1) {
printf(gettext('%u album, 1 photo'), $anumber);
} else if ($anumber > 1 && $inumber > 1) {
printf(gettext('%1$u album, %2$u photos'), $anumber, $inumber);
} else if ($anumber == 1 && $inumber == 0) {
printf(gettext('1 album'));
} else if ($anumber > 1 && $inumber == 0) {
printf(gettext('%u album'),$anumber);
} else if ($anumber == 1 && $inumber > 1) {
printf(gettext('1 album, %u photos'), $inumber);
}
echo ')';
}
$text = getAlbumDesc();
if(strlen($text) > 50) {
$text = preg_replace("/[^ ]*$/", '', substr($text, 0, 50))."...";
}
echo $text;
?>
}
if (!$first) { echo "\n\n</div>\n"; }
?>
`
So if you have a structure like this in your "albums" folder:
- albums
-- folder with 5 pictures
-- folder with 2 subfolders
--- subfolder 1 with 20 pictures
--- subfolder 2 with 30 pictures
-- folder with 20 pictures
-- etc.
It will display
something like this under a folder containg pictures
"Foldername" ( 5 photos)
and under a folder containing subfolders:
"Foldername" ( 2 album)
This is great!
Only thing.... if a folder contains videos it still print "xx photos"
Maybe some coder here is able to add something to this code so it will recognise videofiles and print out "video" instead, then it would be perfect.