/** Display the index action for mapping flickr images * @access public * @return void */ public function indexAction() { if (!$this->getCache()->test('mappingflickr')) { $ph = $this->_api->getPhotosGeoData($start = 0, $limit = 50, $this->_flickr->userid); $this->getCache()->save($ph); } else { $ph = $this->getCache()->load('mappingflickr'); } $this->view->recent = $ph; $this->_response->setHeader('Content-Type', 'application/vnd.google-earth.kml+xml'); }
/** The function * @access public * @param integer $pleiadesID * @return string */ public function pleiadesFlickrImages($pleiadesID) { $html = ''; if (isset($pleiadesID)) { $photos = $this->_api->getMachineTagged('pleiades:depicts=' . $pleiadesID, 5); if (!empty($photos)) { if (array_key_exists('photo', $photos)) { if (is_object($photos->photo)) { $photos = array($photos->photo); } else { $photos = $photos->photo; } if (is_array($photos)) { $html .= '<div class="row-fluid"><h3 class="lead">Photos linked to this Pleiades ID</h3>'; $html .= $this->view->partialLoop('partials/flickr/mints.phtml', $photos); $html .= '</div>'; } } } } return $html; }
/** Get a list of interesting flickr images attributed to archaeology * The woeid 23424975 = United Kingdom * @access public * @return void */ public function interestingAction() { $page = $this->getPage(); $key = md5('interesting' . $page); if (!$this->getCache()->test($key)) { $flickr = $this->_api->getArchaeology('archaeology', 20, $page, 23424975); $this->getCache()->save($flickr); } else { $flickr = $this->getCache()->load($key); } $pagination = array('page' => $page, 'total_results' => (int) $flickr->total); $paginator = Zend_Paginator::factory($pagination['total_results']); $paginator->setCurrentPageNumber($page)->setPageRange(10)->setCache($this->getCache()); $paginator->setItemCountPerPage(20); $this->view->paginator = $paginator; $this->view->photos = $flickr; }