Building upon the success of my
previous request, I was wondering if anyone would want to help me out with my next issue.
I'm trying to build my image.php such that clicking the image will send you to the next image and so on, until the last image that would in theory send you back to the first. A simple cycle.
I'm thinking it would be useful in this case to have a function call the first image of the album, and get the URL from that. If there's a simpler way, let me know!
Comments
`$firstimage = $_zp_current_album->getImage(0);`
does exactly what you want :-)
How can i get any image full link using id?
Anyway, there is no way to create a link which uses the ID as the linked object. Zenphoto works only with album/image names.
If you just want to find an image by id you can always use a SQL SELECT query.
`
function getImageLinkbyID($id) {
$image = query_single_row("SELECT ``albumid`,`filename` FROM " . prefix('images') . " WHERE `id`=" . $id);
$album = query_single_row("SELECT `folder` FROM " . prefix('albums') . " WHERE `id`=" . $image['albumid']);
$url = html_encode(getGalleryIndexURL(false)) . "?album=" . $album['folder'] . "%26image=" . $image['filename'];
return($url);
}
On Mobile Safari (on my ipod touch, or on regular Safari with ipod user-agent) link containing url-encoded '&' symbol (%26) shows following error:
Zenphoto Error: the requested object was not found.
Album: okhotsk_seashore/coastâ„‘=nuklya_cape_sunset.jpg
Is it zenphoto or mobile safari bug?