Member
Member
risbac   2010-12-16, 22:51
#1

I'm trying to customize a theme to add random photos.
Here is the idea:
-on the homepage, two random photos. Then the list of albums
-on an album page, if there are sub albums, two random photos from those sub albums, then the list of sub albums

I managed to do it on the homepage, but on the album page, no way to make it work:

basically, I'm just doing this twice:

"makeImageCurrent(getRandomImagesAlbum());
printCustomSizedImageMaxSpace(getImageTitle(),550,550);"

But then no way to display the sub albums: it just shows the photos of the sub gallery of the second random photo. I don't know how to "reset" the album page to display the sub albums. I'm a beginner with Zenphoto, sorry if it's a silly question.

Member
Member
sbillard   2010-12-17, 00:56
#2

function saveContext() { global $_zp_current_album, $_zp_current_image; return array($zp_current_album,$_zp_current_image, get_context()); } function restoreContext($saved_context) { global $_zp_current_album, $_zp_current_image; list($_zp_current_album, $_zp_current_image,$context) = $saved_context; set_context(context); }
to use: before your code place

$context = saveContext();
and after place
restoreContext($context);

Caveat: I have just typed this in, there may be errors. But the idea is correct, just fix any thing I got a little wrong.

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