Quantcast
Channel: Zenphoto forum
Viewing all articles
Browse latest Browse all 2917

XavierJ on "printLatestImagesByDate and link back"

$
0
0

Hello,
Zenphoto is great, I use it since a few years and really enjoy it.

I'm currently building a new site. On the gallery of this new site, I woud like to show the 12 last uploaded images in an album.
I use the function printLatestImagesByDate() to do that and it works well.
When I'm on the image on the image.php file, and come from the last images album, I would like to put link for the visitor to get directly back to the album of the last images, but I don't know how to do that. Idem for the next and previous image link.

Currently, when I use the navigation of the image.php page, it does get back to the original album the image was uploaded to.

For the link back to the album, I currently use this function I've made :

function getParentSearchURL()
{
global $_zp_gallery, $_zp_current_search, $_zp_current_album, $_zp_last_album;
if (in_context(ZP_SEARCH_LINKED)) {
$page = $_zp_current_search->page;
$searchwords = $_zp_current_search->getSearchWords();
$searchdate = $_zp_current_search->getSearchDate();
$searchfields = $_zp_current_search->getSearchFields(true);
$search_album_list = $_zp_current_search->getAlbumList();
if (!is_array($search_album_list)) {
$search_album_list = array();
}
$searchpagepath = getSearchURL($searchwords, $searchdate, $searchfields, $page, array('albums' => $search_album_list));
$dynamic_album = $_zp_current_search->getDynamicAlbum();
if (empty($dynamic_album))
{
return $searchpagepath;
}
}

return null;
}

How to build the link?

Thank you by advance,
Xavier


Viewing all articles
Browse latest Browse all 2917

Trending Articles