You are here

static function ImageGateway::find_details in Node Gallery 6

2 calls to ImageGateway::find_details()
Gallery::get_images in ./node_gallery.model.inc
gallery_gateway::get_images in ./node_gallery.model.inc

File

./node_gallery.model.inc, line 207
Node gallery module.

Class

ImageGateway

Code

static function find_details($nids) {
  $nids = is_numeric($nids) ? array(
    $nids,
  ) : (array) $nids;
  $sql = "SELECT n.nid, n.vid, n.title, n.type, n.created, nr.body, i.*, f.* FROM {node} n \n      INNER JOIN {node_revisions} nr ON n.vid = nr.vid INNER JOIN {ng_images} i \n      ON n.nid = i.nid INNER JOIN {files} f ON i.fid = f.fid WHERE n.nid IN (" . db_placeholders($nids) . ") AND n.status = 1\n       ORDER BY i.weight, i.nid";
  $result = db_query($sql, $nids);
  while ($o = db_fetch_object($result)) {
    $items[$o->nid] = new Image($o);
  }
  if (module_exists('content')) {
    foreach ($items as &$item) {
      $content_type = content_types($item->type);
      if (!empty($content_type['fields'])) {
        content_load($item);
      }
    }
  }
  return $items;
}