ZenphotoCMS Forum
How i get the a album thumb with just passing the name of the album? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: How i get the a album thumb with just passing the name of the album? (/thread-6022.html)



How i get the a album thumb with just passing the name of the album? - pachito86 - 2009-10-22

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.




How i get the a album thumb with just passing the name of the album? - acrylian - 2009-10-22

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.




How i get the a album thumb with just passing the name of the album? - pachito86 - 2009-10-22

so should i create a album object with the "Constructor for albums" and then pass it to getAlbumThumbImage() method??




How i get the a album thumb with just passing the name of the album? - acrylian - 2009-10-23

Exactly.




How i get the a album thumb with just passing the name of the album? - pachito86 - 2009-10-25

thank you!!




How i get the a album thumb with just passing the name of the album? - pachito86 - 2009-10-27

i can't make it work, i get this error "Fatal error: Call to undefined function Album() "
My code is:

Some suggestion, i guess i'm writing something wrong in the Album function but i can't understand what...




How i get the a album thumb with just passing the name of the album? - acrylian - 2009-10-27

Well, you need to learn the php basics of working object orientated. There are also some typos:

``

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.




How i get the a album thumb with just passing the name of the album? - pachito86 - 2009-10-27

really thank you!Amazing help from the support!




How i get the a album thumb with just passing the name of the album? - pachito86 - 2009-10-27

This is the way i solved:

`

[img][/img]getTitle() ?>" />

`