The simpler media website CMS
Forum search only. You might also want to search on the main site's user guide.
Forum RSS
Visit the troubleshooting guide.
Visit the paid support page.
Your support helps pay for this server, and helps development of zenphoto. Thank you!
Visit the donations page
$albums = mysql_query("select * from ".prefix('albums')." as albums where albums.title= '".$albumtitle."'"); while($a = mysql_fetch_array($albums)) { $album_id = $a['id']; $album = $a['folder']; }
$image = mysql_query("select * from ".prefix('images')." as images where images.albumid = $album_id ORDER BY RAND() LIMIT 1"); while($i = mysql_fetch_array($image)) { $filename = $i['filename']; $desc = $i['title']; }
if (zp_conf('mod_rewrite') == false) { echo ''; } else { echo ''; }
echo '';}`
Comments
`
function random_image($albumtitle){
$size = '_'.zp_conf('thumb_size').'_cw'.zp_conf('thumb_crop_width').'_ch'.zp_conf('thumb_crop_height');
$albums = mysql_query("select * from ".prefix('albums')." as albums where albums.title= '".$albumtitle."'");
while($a = mysql_fetch_array($albums)) {
$album_id = $a['id'];
$album = $a['folder'];
}
$image = mysql_query("select * from ".prefix('images')." as images where images.albumid = $album_id ORDER BY RAND() LIMIT 1");
while($i = mysql_fetch_array($image)) {
$filename = $i['filename'];
$desc = $i['title'];
}
if (zp_conf('mod_rewrite') == false) {
echo '';
} else {
echo '';
}
echo '';
}
`
you can try the zenshow plugin for wordpress. It still exists at http://www.zenphoto.org/trac/wiki/ZenphotoPlugins (look for it at the attachments on the bottom of the page). It may still be available at http://www.ruicruz.com/index.php/zenshow/ with some instructions (last I checked)
It seems to work OK for me on my current wordpress and zenphoto implementation.
Fatal error:
Call to undefined function: zp_conf() in /homepages/.../zp-core/functions.php on line 1891
or is there another way around to get a rendom image from a specific album. curently i´m using this in my index.php:
`
<?php $randomImage = getRandomImages(); $randomImageURL = getURL($randomImage); print<br />
"getSizedImage('400')."' alt='".$randomImage->getTitle()."'/>"; ?>
`
that works fine, unless i need a random image from
specific album...
can somebody help?
We have already a functions for that build in version 1.1.5. Take a look on the functions guide www.zenphoto.org/documentation-official
`
<?php $randomImage = getRandomImages(); $randomImageURL = getURL($randomImage); print<br />
"getSizedImage('400')."' alt='".$randomImage->getTitle()."'/>"; ?>
`
with
`
<?php $randomImage = getRandomImagesAlbum("Album1"); $randomImageURL = getURL($randomImage); print<br />
"getSizedImage('400')."' alt='".$randomImage->getTitle()."'/>"; ?>
`
works great!
THX