Member
Member
pachito86   2009-10-22, 13:08
#1
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.
Administrator
Administrator
acrylian   2009-10-22, 13:43
#2
http://www.zenphoto.org/documentation/classes/Album.html#methodgetAlbumThumbImage
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.
Member
Member
pachito86   2009-10-22, 21:54
#3
so should i create a album object with the "Constructor for albums" and then pass it to getAlbumThumbImage() method??
Administrator
Administrator
acrylian   2009-10-23, 08:53
#4
Exactly.
Member
Member
pachito86   2009-10-25, 11:30
#5
thank you!!
Member
Member
pachito86   2009-10-27, 09:39
#6
i can't make it work, i get this error "Fatal error: Call to undefined function Album() "
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...
Administrator
Administrator
acrylian   2009-10-27, 10:39
#7
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.
Member
Member
pachito86   2009-10-27, 12:06
#8
really thank you!Amazing help from the support!
Member
Member
pachito86   2009-10-27, 12:51
#9
This is the way i solved:

`

<?php $album = new Album($_zp_gallery,"dfm091024divinae",TRUE);?>

[img]<?php getGalleryIndexURL() ?><?php echo $album->getAlbumThumb() ?>[/img]getTitle() ?>" />

`
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.