daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private function getGalleryJSON($label){
  2.  
  3.         $toJSon->items = array();
  4.  
  5.         //Photos
  6.         $query = new Doctrine_Query();
  7.         $query->from('SitePhoto p');
  8.         $query->where('p.label=?', array($label));
  9.         $photos = $query->execute();
  10.  
  11.         $i = 0;
  12.  
  13.         foreach ($photos as $p){
  14.  
  15.            $toJSon->items[$i]->thumb = __BASE_URL.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.'photos'.DIRECTORY_SEPARATOR.$label.DIRECTORY_SEPARATOR.'thumb_'.$p->fname;
  16.            $toJSon->items[$i]->large = __BASE_URL.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.'photos'.DIRECTORY_SEPARATOR.$label.DIRECTORY_SEPARATOR.$p->fname;;
  17.            $toJSon->items[$i]->title = $p->name;
  18.            $toJSon->items[$i]->link = '';
  19.  
  20.            $i++;
  21.         }
  22.  
  23.  
  24.         return str_replace("\\", '',json_encode($toJSon));      
  25.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top