You are here

function andromeda_slideshow_load_slideshow_images in Andromeda Slideshow 7

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

Loads the images for a slideshow

Parameters

$sid: the slideshow sid

4 calls to andromeda_slideshow_load_slideshow_images()
andromeda_slideshow_admin in includes/andromeda_slideshow.admin.inc
Slideshow admin
andromeda_slideshow_block_view in ./andromeda_slideshow.module
Implements hook_block_view().
andromeda_slideshow_image_form_submit in includes/andromeda_slideshow.forms.inc
Submit handler for andromeda_slideshow_image_form
andromeda_slideshow_manage_form in includes/andromeda_slideshow.forms.inc
Manage images for a slideshow form

File

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

Code

function andromeda_slideshow_load_slideshow_images($sid) {
  $images = array();
  $query = db_select('slideshows_images', 'si');
  $query
    ->join('slideshows_index', 's', 'si.siid = s.siid');
  $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('s', 'position');
  $query
    ->addField('si', 'caption');
  $query
    ->addField('si', 'settings');
  $images = $query
    ->orderBy('s.position')
    ->condition('s.sid', $sid)
    ->execute()
    ->fetchAllAssoc('siid');
  foreach ($images as $index => $image) {
    $images[$index]->settings = drupal_json_decode($image->settings);
  }
  return $images;
}