You are here

function andromeda_slideshow_load_images in Andromeda Slideshow 7

Same name and namespace in other branches
  1. 7.2 andromeda_slideshow.module \andromeda_slideshow_load_images()

Loads multiple images by their $siids

1 call to andromeda_slideshow_load_images()
andromeda_slideshow_image_load in ./andromeda_slideshow.module
Loads an image by its $siid

File

./andromeda_slideshow.module, line 421
Slideshow for the Andromeda (http://drupal.org/project/andromeda) Theme

Code

function andromeda_slideshow_load_images($siids = array()) {
  $images = array();
  $query = db_select('slideshows_images', 'si');
  $query
    ->join('file_managed', 'f', 'si.fid = f.fid');
  $query
    ->addField('si', 'siid');
  $query
    ->addField('si', 'fid');
  $query
    ->addField('f', 'uri');
  $query
    ->addField('si', 'title');
  $query
    ->addField('si', 'caption');
  $query
    ->addField('si', 'settings');
  if (sizeof($siids)) {
    $query
      ->condition('si.siid', $siids, 'IN');
  }
  $images = $query
    ->execute()
    ->fetchAllAssoc('siid');
  foreach ($images as $index => $image) {
    $images[$index]->settings = drupal_json_decode($image->settings);
  }
  return $images;
}