You are here

function node_gallery_get_rid_to_gallery_types in Node Gallery 6.3

Builds an array that associates rid's with gallery types.

Parameters

$reset: (optional) A boolean that when set to true will clear the cache.

Return value

An associative array where the keys are the rid's and the values are the gallery content types.

1 call to node_gallery_get_rid_to_gallery_types()
node_gallery_get_relationship in ./node_gallery.inc
Fetches a gallery-to-image relationship from the database.

File

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

Code

function node_gallery_get_rid_to_gallery_types($reset = FALSE) {
  static $r2g = array();
  if (empty($r2g) || $reset) {
    $result = db_query("SELECT rid, gallery_type from {node_gallery_relationships}");
    while ($r = db_fetch_array($result)) {
      $r2g[$r['rid']] = $r['gallery_type'];
    }
  }
  return $r2g;
}