I am not sure I understand what you want to do actually. $_zp_gallery->getNumAlbums() gets you the number of toplevel albums, thus if there are albums in the /albums folder at all.
Thanks Acrylian for your quick one. Anyway what i intended to do was check wether a certain folder eg 'windows' existed in the albums folder. Thanks a million
Ok, but your codes uses $_zp_current_album. So that album apparently exists why the check does not make real sense to me...
The way to check for a toplevel album existing is to use the object model. ` $albums = $_zp_gallery->getAlbums(); foreach($albums as $album) { if($album == '') {
} } ` Or just try to create the object...if the album is not there it will not work (you can check with $obj->exists btw).
Comments
I meant to check wether a folder is in the albumfolder (getAlbumFolder()).
Regards,
Jackson
http://www.zenphoto.org/documentation/classes/Gallery.html#methodgetNumAlbums
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetNumAlbums
I used this and works;
if ($_zp_current_album->gallery->albumdir.$_zp_current_album->name."/"===$_zp_current_album->localpath) {//do something }
Regards
JACKSON
The way to check for a toplevel album existing is to use the object model.
`
$albums = $_zp_gallery->getAlbums();
foreach($albums as $album) {
if($album == '') {
}
}
`
Or just try to create the object...if the album is not there it will not work (you can check with $obj->exists btw).