예제 #1
0
 public function imageAction()
 {
     if ($this->auth->hasIdentity()) {
         $getphoto = new Application_Model_Images($this->registry['DB']);
         $albumid = $this->getRequest()->getParam('albumid');
         $userid = $this->getRequest()->getParam('userid');
         $this->view->results = $getphoto->getImages($albumid, null, 'album', $userid);
         $this->view->mydetails = $this->authIdentity;
     }
 }
예제 #2
0
 public function placesAction()
 {
     $getimage = new Application_Model_Images($this->registry['DB']);
     //$imageid=$this->getRequest()->getParam('imageid');
     //$this->view->results=$this->authIdentity;
     $this->view->results = $getimage->getImages('10', 'image');
     //$this->_helper->viewRenderer->setNoRender(true);
     //$this->getResponse()->setBody(json_encode($places->uploadImage($album)));
     //$this->view->results= $places->getUserDetailts('leaf_1164721637_31408804');
     //$this->view->results= $places->doComment(1, 'ifadfja');
 }
 /**
  * Show images
  */
 public function imagesAction()
 {
     $Images = new Application_Model_Images();
     $Albums = new Application_Model_Albums();
     $request = $this->getRequest();
     // flush if user not found
     if (!$this->profile) {
         $this->redirect('');
     }
     $page = (int) $request->getParam('page');
     if ($page < 1) {
         $page = 1;
     }
     $album_id = $request->getParam('album', false);
     $current_album_count = $Images->getImages($this->profile->id, $album_id, true);
     $Images->page_number = $page;
     $this->view->images = $Images->getImages($this->profile->id, $album_id);
     $this->view->pagination_last_page = (int) ceil($current_album_count / (int) Zend_Registry::get('config')->get('pagination_limit'));
     $this->view->pagination_current_page = $page;
     $this->prepareProfile($this->profile);
     $this->prepareImagesAlbumsCount();
     if (!$album_id) {
         $this->view->active_item = 'all';
         $this->view->context = 'images';
     } else {
         $album = $Albums->getAlbum($album_id);
         $this->view->active_item_id = $album['id'];
         $this->view->active_item = $album['name'] . ' (' . $current_album_count . ')';
         $this->view->context = 'album';
     }
     $this->render('images');
 }