![]() |
|
Random image from (sub)albums - combining album.php and image.php - 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: Random image from (sub)albums - combining album.php and image.php (/thread-3654.html) |
Random image from (sub)albums - combining album.php and image.php - kjtooke - 2008-08-31 I'd like to have an image shown on every page (not just image.php)... On index.php I'd like to have a random image shown (above thumbnails for albums) selected at random from ALL albums... On album.php I'd like to have a random image shown (above thumbnails for albums) selected at random from all SUB-albums... How do I achieve this? (Also, on image.php I'd like to have a fixed number of thumbnails shown below the main image, but that's another issue...) ( work-in-progress: http://mkiv.kjtooke.dyndns.org/ ) Random image from (sub)albums - combining album.php and image.php - sterk - 2008-08-31 printRandomImages Random image from (sub)albums - combining album.php and image.php - sbillard - 2008-08-31 The efferevescence+ theme does this. You can review how it accomplishes it. Random image from (sub)albums - combining album.php and image.php - kjtooke - 2008-09-01 OK, got that sorted using the relevant part of the customfunctions.php script from effervescence+ Is there anyway of incorporating the following into this script: if (getFullWidth() === getFullHeight() OR getFullWidth() > getFullHeight()) { Random image from (sub)albums - combining album.php and image.php - kjtooke - 2008-09-01 Hmmm... It seems to be picking a random image from the entire gallery. This is fine for index.php, but for album.php I want it limited to the current album and/or any subalbums. Is there a setting or fix for this? Random image from (sub)albums - combining album.php and image.php - sbillard - 2008-09-01 Effervescence+ uses two different functions for random images. In index.php page it uses As for adding the code above, just put it in your version of the script. Random image from (sub)albums - combining album.php and image.php - kjtooke - 2008-09-01 already had it coded that way... this only happens when I'm logged in - when logged out it works as expected. Random image from (sub)albums - combining album.php and image.php - kjtooke - 2008-09-01 how do I get getFullWidth() and getFullHeight() on this random pic? as I'm not on the relevent url for whatever random pic is selected, is there a way of manually passing the random pic url to these functions? I need a way of setting the size of the image so it fits inside a 600px wide by 400px tall canvas without cropping $size is limited to width (whereas I need height) Random image from (sub)albums - combining album.php and image.php - sbillard - 2008-09-01
Random image from (sub)albums - combining album.php and image.php - kjtooke - 2008-09-02 Thanks... Random image from (sub)albums - combining album.php and image.php - kjtooke - 2008-09-07 My new theme is almost complete... Just one last thing I'd like to try to incorporate with regards to random images: How do I get a random images from (limited to) the search results? I'd like to display this above the thumbs on the search results page (so that it matches the rest of the theme pages). |