Member
Member
weweje   2010-03-20, 13:04
#1

Hello there!

In the theming tutorial is suggested to use a while (next_album()): loop to show off all the galleries.
1- If i'm not wrong, this loop is album.php context only.
2- If so how can I display a random image extracted from a definedById album inside index.php? ( following those guidelines for splashpage in zenphoto > http://www.zenphoto.org/support/topic.php?id=7120#post-41789 )

My purpose here is to create a splashpage for my gallery with just one random image - extracted from a hidden 'splashpage' gallery.

thank you for your kind help

Member
Member
weweje   2010-03-20, 13:38
#2

edit


For now on, I've succeeded in extracting an image from the first gallery this way:
`

But what if one wants to extract an image from the gallery #5 ? Can you point out the functions handling gallery ID? getNumAlbums()returns the correct sum of albums but getAlbumID()returns a different index andgetAlbumIndex()` just doesn't work

Administrator
Administrator
acrylian   2010-03-20, 14:42
#3

the next_album loop works on index.php and album.php. Also acutally on other pages but it can only be called once per page.
Otherwise you have to use the object model framework.

But for random images see:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetRandomImages
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetRandomImagesAlbum
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintRandomImages

btw, "gallery" means the whole Zenphoto gallery, you are talking about an "album".

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