public function reorder($album_id = NULL)
 {
     $album = new Album_Model($album_id);
     if (!$album->id) {
         Event::run('system.404');
     }
     javascript::add(array('jquery-ui', 'photo_admin_effects'));
     stylesheet::add(array('photo_gallery'));
     $this->template->title = $album->album_name;
     $this->template->heading = $album->album_name;
     $this->template->content = new View('admin/album/reorder');
     $this->template->content->photos = $album->find_related('photos', array(), array('photo_order' => 'ASC'));
     $this->template->content->album = $album;
 }
 public function view($album_name = NULL)
 {
     javascript::add(array('jquery.colorbox', 'photo_effects'));
     stylesheet::add(array('colorbox', 'colorbox-custom', 'photo_gallery'));
     $page_num = $this->input->get('page', 1);
     $album = new Album_Model($album_name);
     if (!$album->id) {
         Event::run('system.404');
     }
     $this->template->title = $album->album_name;
     $this->template->heading = $album->album_name;
     $this->template->content = new View('album/view');
     $this->template->content->photos = $album->find_photos($page_num);
     $this->template->content->album = $album;
     $this->template->content->num_pages = ceil(count($album->find_related('photos')) / Kohana::config('photo_gallery.photos_per_page'));
 }
Beispiel #3
0
 /**
  * 取得某条留言标题
  * @param integer $appid 留言唯一标识
  *
  */
 public function getOnlySubject($sign = 1, $appid)
 {
     switch ($sign) {
         case 1:
             $subject = $this->db->getOne('diary', 'subject', "id='{$appid}'");
             break;
         case 2:
             $subject = $this->db->getOne('vote', 'subject', "id='{$appid}'");
             break;
         case 3:
             $subject = $this->db->getOne('userrecord', 'content', "id='{$appid}'");
             break;
         case 4:
             $album = new Album_Model();
             $array = $album->getAlbumInfoByAid($appid);
             $subject = $array['data']['album_name'];
             break;
         case 5:
             $photo = new Photo_Model();
             $array = $photo->getPhotoInfoByPid($appid);
             $subject = $array['data']['pic_title'];
             break;
         case 6:
             $album = new Group_Model();
             $array = $album->getAlbumInfoByAid($appid);
             $subject = $array['data']['album_name'];
             break;
         case 7:
             $photo = new Group_Model();
             $array = $photo->getPhotoInfoByPid($appid);
             $subject = $array['data']['pic_title'];
             break;
         case 8:
             $album = new Group_Model();
             $array = $album->getAlbumInfoByAid($appid);
             $subject = $array['data']['group_id'];
             break;
         default:
             break;
     }
     return $subject;
 }