You are here

function node_gallery_get_image_list in Node Gallery 6.3

Gets a sorted list of images nids within a gallery.

Parameters

$gid: The nid of the gallery to query.

$reset: (optional) If TRUE, clears the cache, defaults to FALSE.

Return value

An array of sorted image nids with a status of published.

5 calls to node_gallery_get_image_list()
node_gallery_get_first_image in ./node_gallery.inc
Gets the first image nid within a gallery.
node_gallery_get_image_count in ./node_gallery.inc
Gets the count of published images within a gallery.
node_gallery_get_image_navigator in ./node_gallery.inc
Builds an array with the data necessary to navigate a gallery.
node_gallery_get_last_image in ./node_gallery.inc
Gets the last image nid within a gallery.
node_gallery_seek_from_current_image in ./node_gallery.inc
Returns the nid of the image +/-N steps away from the current image node.

File

./node_gallery.inc, line 660
Shared functions for node_gallery

Code

function node_gallery_get_image_list($gid, $reset = FALSE) {
  static $image_list = array();
  if (!isset($image_list[$gid]) || $reset) {
    if (!$reset && ($cache = cache_get('node_gallery:' . $gid . ':image_list'))) {
      $image_list[$gid] = $cache->data;
    }
    else {
      _node_gallery_cache_sorted_image_nids($gid);
      $cache = cache_get('node_gallery:' . $gid . ':image_list');
      $image_list[$gid] = $cache->data;
    }
  }
  return $image_list[$gid];
}