Hello everybody, i would like to know if exists a function which give me the album thumb for a determinate name album. Thank you in advance. If doesn't exist some suggestion are perfect.
Well, you need to learn the php basics of working object orientated. There are also some typos:
`<?php $album= new Album($_zp_gallery,"dfm091024divinae",TRUE); ?>`
The parent gallery to be passed as the first parameter means the gallery object which is stored in `$_zp_gallery` on the theme pages. It is NOT the parent album! In Zenphoto terms the term "gallery" refers Zenphoto in total, not to an album (see the glossary, too). Note: If you trying to create an object from a subalbum you need to pass the full name with the parent folder like `toplevelalbumname/subalbumname` since you can have albums of the same name within different albums.
Also `getAlbumThumbImage($album)` does nothing. You have either to do `$thumbimage = getAlbumThumbImage($album)`, then echo the variable or `echo getAlbumThumbImage($album)`. Note that if no album thumb is set this function returns an image object.
Comments
Note this is a album class method which means you have to create an album object of the album to get the thumb from first.
My code is:
<?php $album=Album(getParent(),dfm091024divinae,TRUE) ?>
<?php getAlbumThumbImage($album) ?>
Some suggestion, i guess i'm writing something wrong in the Album function but i can't understand what...
`<?php $album= new Album($_zp_gallery,"dfm091024divinae",TRUE); ?>`
The parent gallery to be passed as the first parameter means the gallery object which is stored in `$_zp_gallery` on the theme pages. It is NOT the parent album! In Zenphoto terms the term "gallery" refers Zenphoto in total, not to an album (see the glossary, too). Note: If you trying to create an object from a subalbum you need to pass the full name with the parent folder like `toplevelalbumname/subalbumname` since you can have albums of the same name within different albums.
Also `getAlbumThumbImage($album)` does nothing. You have either to do `$thumbimage = getAlbumThumbImage($album)`, then echo the variable or `echo getAlbumThumbImage($album)`. Note that if no album thumb is set this function returns an image object.
`
<?php $album = new Album($_zp_gallery,"dfm091024divinae",TRUE);?>
<?php echo $album->getAlbumThumb() ?>" alt="<?php echo $album->getTitle() ?>" />
`