Posted By

orionrush on 04/03/11


Tagged

indexhibit


Versions (?)

inexhibit in progress


 / Published in: PHP
 

  1. function pullImages()
  2. {
  3. $OBJ =& get_instance();
  4. global $rs;
  5.  
  6. $pages = $OBJ->db->fetchArray("SELECT *
  7. FROM ".PX."media, ".PX."objects_prefs
  8. WHERE media_ref_id = '$rs[id]'
  9. AND obj_ref_type = 'exhibit'
  10. AND obj_ref_type = media_obj_type
  11. ORDER BY media_order ASC, media_id ASC");
  12.  
  13. $s = $rs['content'];
  14.  
  15. if (!$pages) return $s;
  16.  
  17. $i = 1;
  18. foreach ($pages as $go)
  19. {
  20. $title = ($go['media_title'] == '') ? ' ' : $go['media_title'];
  21. $caption = ($go['media_caption'] == '') ? ' ' : $go['media_caption'];
  22.  
  23. $a[] = "{image :'" . BASEURL . GIMGS . "/$go[media_file]', title : '{$title}, {$caption}', url: '" . BASEURL . GIMGS . "/$go[media_file]'}";
  24. $i++;
  25. }
  26. $a = implode(",\n", $a);
  27. $s .= $a;
  28. return $s;
  29. }
  30.  
  31. /*
  32. Here is example output:
  33. <p>WHOA WHATS THIS TEXT DOING HERE?!</p>{image :'http://photolumiere.site:8888/files/gimgs/1_photo-32.jpg', title : ' , ', url: 'http://photolumiere.site:8888/files/gimgs/1_photo-32.jpg'},
  34. {image :'http://photolumiere.site:8888/files/gimgs/1_photo-2.jpg', title : ' , ', url: 'http://photolumiere.site:8888/files/gimgs/1_photo-2.jpg'}
  35. */

Report this snippet  

You need to login to post a comment.