Tristan-
Would zenphoto in its latest SVN version present any differences to this function? I'm trying to figure out why the same function works differently across a couple installations (and themes). I hadn't noticed before that it was directing the URL to the album, not the image, so it seems to be "truncating" the image portion of the URL, even though the image displays correctly. So the DB query is OK, might be something that is wrong in the getURL function that is causing trouble.
Could you take a peek and see if something is amiss? I can't figure out what's causing it.
`function getRandomImages() {
$result = query_single_row('SELECT '.prefix("images").'.filename,'.prefix("images").'.title, '.prefix("albums").'.folder FROM '.prefix("images").' INNER JOIN '.prefix("albums").' ON '.prefix("images").'.albumid = '.prefix("albums").'.id ORDER BY RAND() LIMIT 1');
$image = new Image(new Album(new Gallery(), $result['folder']), $result['filename']);
return $image;
}
function getURL($image) {
if (zp_conf('mod_rewrite'))
{
return WEBPATH . "/" . pathurlencode($image->getAlbumName()) . "/" . urlencode($image->name);
}
else
{
return WEBPATH . "/index.php?album=" . pathurlencode($image->getAlbumName()) . "&image=" . urlencode($image->name);
}
}
`