Any chance anybody could whip up a random photo style plug-in (and by plug-in I mean line of php code). Better yet would be the option to choose "random photo" or "random photo from specific album".
And it might not make sense to simply pull a random photo. Instead it might be more useful to display the thumbnail for a random photo and then link directly to that photo within it's own album.
Thank you very much.
Comments
I'm looking for ways on how to display random image per album. Is there a way to achieve this? There's no option for this in the program. There are about 200 photos in one album and viewers dont really go through all images on the albums so it's the same pictures are getting viewed. At least randow view based on file names.
Thank you.
http://www.zenphoto.org/documentation-official/zenphoto/_template-functions.php.html#functiongetRandomImages
http://www.zenphoto.org/documentation-official/zenphoto/_template-functions.php.html#functiongetRandomImagesAlbum
http://www.zenphoto.org/trac/ticket/555
[code]$imageWhere = " AND " . prefix('images') . ".`show`=1"[/code]
Thanks.
Thank you for this piece of code. I have few questions because I cant seem to make it work.
1.) I placed random.php under zp-core and tested on the browser using http://mylocalgallery.com/zenphoto/zp-core/random.php?
num=9&height=50&width=50. I also tried with "class=" but it's not working.
There are boxes of thumbnails but the pictures are not showing. It displayed the filename of the image. I got this "Zenphoto Error: the requested object was not found." error when I clicked on the thumbnail.
2. If I set the parameters or default value for num, height, width, class on random.php, will "http://mylocalgallery.com/zenphoto/zp-core/random.php" work?
So how to set getRandomImages? I only have one album with 200 images.
Thank you.
This is code i have now to do the above described job:
`
`
Where should I put fatman's code for the external php site?
`@readfile('http://yourgallery.com/zen/zp-core/random.php?
num=15&height=120&width=120&class=one-image&album=damjanci-ponaosob')`
I already have random.php in place. Does random.php has to be edited in any way?
`
<?php @readfile('http://yourgallery.com/zen/zp-core/random.php?<br />
num=15&height=120&width=120&class=one-image&album=damjanci-ponaosob') ?>
`
It's working!!! Thank you very much. I would like to have it on click to open main zenphoto site instead of random photo you clicked on. That way visitors would be aware of all albums there. I guess this could be done with changing values in random.php but again I'm not sure which one should be changed. Could you please point me to that value?
Replacing `getURL($randomImage);` with `getGalleryIndexURL()` should work.
Parse error: syntax error, unexpected T_ECHO in /home/da_mja_nac/public_html/da_mja_nci/zen/zp-core/random.php on line 36
http://www.zenphoto.org/trac/ticket/555
i updated from zenphoto version 1.2.4 [3841] to 1.2.5 [4110]
"Zenphoto Error
Bad gallery in album instantiation"
i'm also using this script
<?
define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'zenphoto');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
$randomImage = getRandomImages();
echo "<img src='". $randomImage->getSizedImage(getOption('image_size')) . "'
alt=\"random image\"\n" . $randomImage->getTitle() . '" />';
?>
Sorry, I can't help with that random addon as I did not write it. Try to contact its developer or maybe he will still visit this forum.
Zenphoto Error
Bad gallery in album instantiation
Backtrace:
in Album->Album (template-functions.php [3356])
in getRandomImages (zp-foto-random-script.php [18])
line 18 in zp-foto-random-script.php is
$randomImage = getRandomImages();
`$_zp_gallery = new Gallery();`
before you call any functions.
We will try to make a general solution to this as well.