function node_gallery_seek_from_current_image in Node Gallery 6.3
Returns the nid of the image +/-N steps away from the current image node.
Parameters
$gid: The nid of the gallery to query.
$nid: The nid of the current image.
signedint $seek: The postive or negative number of slots to seek to.
$reset: (optional) If TRUE, clears the caches. Defaults to FALSE.
2 calls to node_gallery_seek_from_current_image()
- node_gallery_get_next_image in ./
node_gallery.inc - Gets the next image in the gallery.
- node_gallery_get_prev_image in ./
node_gallery.inc - Gets the previous image in the gallery.
File
- ./
node_gallery.inc, line 766 - Shared functions for node_gallery
Code
function node_gallery_seek_from_current_image($gid, $nid, $seek, $reset) {
$image_list = node_gallery_get_image_list($gid, $reset);
$current_position = node_gallery_get_image_position($gid, $nid, $reset);
$current_index = $current_position - 1;
$seek_index = $current_index + $seek;
return isset($image_list[$seek_index]) ? $image_list[$seek_index] : NULL;
}