Esempio n. 1
0
 /** Find photos with a set radius of the where on earthID
  */
 public function whereonearthAction()
 {
     $woeid = (int) $this->getParam('id');
     $page = $this->getPage();
     $this->view->place = $woeid;
     $key = md5('woeid' . $woeid . $page);
     if (!$this->getCache()->test($key)) {
         $flickr = $this->_api->getWoeidRadius($woeid, $radius = 500, $units = 'm', $per_page = 20, $page, 'archaeology', '1,2,3,4,5,6,7');
         $this->getCache()->save($flickr);
     } else {
         $flickr = $this->getCache()->load($key);
     }
     $total = $flickr->photos->total;
     $perpage = $flickr->photos->perpage;
     $pagination = array('page' => $page, 'per_page' => $perpage, 'total_results' => (int) $total);
     $paginator = Zend_Paginator::factory($pagination['total_results']);
     $paginator->setCurrentPageNumber($pagination['page'])->setItemCountPerPage(20)->setPageRange(10)->setCache($this->getCache());
     $this->view->paginator = $paginator;
     $this->view->pictures = $flickr;
 }