예제 #1
0
파일: album.php 프로젝트: uzura8/flockbird
 /**
  * Album detail
  * 
  * @access  public
  * @params  integer
  * @return  Response
  */
 public function action_detail($id = null)
 {
     $id = (int) $id;
     $album = Model_Album::check_authority($id, null, 'member');
     $this->check_browse_authority($album->public_flag, $album->member_id);
     // 既読処理
     if (\Auth::check()) {
         $this->change_notice_status2read($this->u->id, 'album', $id);
     }
     $disabled_to_update = \Album\Site_Util::check_album_disabled_to_update($album->foreign_table);
     list($limit, $page) = $this->common_get_pager_list_params(\Config::get('articles.limit'), \Config::get('articles.limit_max'));
     $data = Model_AlbumImage::get_pager_list(array('related' => array('album'), 'where' => \Site_Model::get_where_params4list(0, \Auth::check() ? $this->u->id : 0, $this->check_is_mypage($album->member_id), array(array('album_id', $id))), 'limit' => $limit, 'order_by' => array('id' => 'desc')), $page);
     if (\Config::get('album.display_setting.detail.display_upload_form') && !$disabled_to_update && \Auth::check() && $album->member_id == $this->u->id) {
         $data['val'] = self::get_validation_public_flag();
     }
     $data['id'] = $id;
     $data['album'] = $album;
     $data['is_member_page'] = true;
     $data['disabled_to_update'] = $disabled_to_update;
     $data['liked_album_image_ids'] = conf('like.isEnabled') && \Auth::check() ? \Site_Model::get_liked_ids('album_image', $this->u->id, $data['list']) : array();
     $this->set_title_and_breadcrumbs($album->name, null, $album->member, 'album', null, false, false, array('title' => $album->name, 'description' => $album->body, 'image' => \Site_Util::get_image_uri4image_list($data['list'], 'ai', 'raw')));
     $this->template->subtitle = \View::forge('_parts/detail_subtitle', array('album' => $album, 'disabled_to_update' => $disabled_to_update));
     $this->template->post_footer = \View::forge('_parts/detail_footer');
     $this->template->post_footer = \View::forge('_parts/detail_footer', array('is_mypage' => check_uid($album->member_id)));
     $this->template->content = \View::forge('detail', $data);
 }
예제 #2
0
파일: thread.php 프로젝트: uzura8/flockbird
 /**
  * Thread detail
  * 
  * @access  public
  * @params  integer
  * @return  Response
  */
 public function action_detail($id = null)
 {
     $thread_id = (int) $id;
     $thread = Model_Thread::check_authority($thread_id);
     $this->check_browse_authority($thread->public_flag, $thread->member_id);
     // 既読処理
     if (\Auth::check()) {
         $this->change_notice_status2read($this->u->id, 'thread', $id);
     }
     // thread_image
     $images = Model_ThreadImage::get4thread_id($thread_id);
     // thread_comment
     $default_params = array('latest' => 1);
     list($limit, $is_latest, $is_desc, $since_id, $max_id) = $this->common_get_list_params($default_params, conf('view_params_default.detail.comment.limit_max'));
     list($list, $next_id, $all_comment_count) = Model_ThreadComment::get_list(array('thread_id' => $thread_id), $limit, $is_latest, $is_desc, $since_id, $max_id, null, false, true);
     // thread_like
     $is_liked_self = \Auth::check() ? Model_ThreadLike::check_liked($id, $this->u->id) : false;
     $title = array('name' => $thread->title);
     $header_info = array();
     $ogp_infos = array('title' => $thread->title, 'description' => $thread->body);
     if ($images) {
         $ogp_infos['image'] = \Site_Util::get_image_uri4image_list($images, 't', 'raw');
     }
     $this->set_title_and_breadcrumbs($title, array('thread' => term('thread', 'site.list')), null, 'thread', $header_info, false, false, $ogp_infos);
     $this->template->subtitle = \View::forge('_parts/detail_subtitle', array('thread' => $thread));
     $this->template->post_footer = \View::forge('_parts/comment/handlebars_template');
     $data = array('thread' => $thread, 'images' => $images, 'comments' => $list, 'all_comment_count' => $all_comment_count, 'comment_next_id' => $next_id, 'is_liked_self' => $is_liked_self, 'liked_ids' => conf('like.isEnabled') && \Auth::check() && $list ? \Site_Model::get_liked_ids('thread_comment', $this->u->id, $list) : array());
     $this->template->content = \View::forge('detail', $data);
 }
예제 #3
0
파일: util.php 프로젝트: uzura8/flockbird
 public static function get_timeline_ogp_image_uri($type, $foreign_id, $timeline_id = null, $is_raw_size = false)
 {
     $images = static::get_timeline_images($type, $foreign_id, $timeline_id);
     if (empty($images['list'])) {
         return '';
     }
     $file_cate = !empty($images['file_cate']) ? $images['file_cate'] : 'ai';
     $file_size = $is_raw_size || empty($images['size']) ? 'raw' : $images['size'];
     return \Site_Util::get_image_uri4image_list($images['list'], $file_cate, $file_size);
 }
예제 #4
0
파일: note.php 프로젝트: uzura8/flockbird
 /**
  * Note detail
  * 
  * @access  public
  * @params  integer
  * @return  Response
  */
 public function action_detail($id = null)
 {
     $note_id = (int) $id;
     $note = Model_Note::check_authority($note_id);
     $this->check_browse_authority($note->public_flag, $note->member_id);
     // 既読処理
     if (\Auth::check()) {
         $this->change_notice_status2read($this->u->id, 'note', $id);
     }
     // note_album_image
     $images = is_enabled('album') ? Model_NoteAlbumImage::get_album_image4note_id($id) : array();
     // note_comment
     $default_params = array('latest' => 1);
     list($limit, $is_latest, $is_desc, $since_id, $max_id) = $this->common_get_list_params($default_params, conf('view_params_default.detail.comment.limit_max'));
     list($list, $next_id, $all_comment_count) = Model_NoteComment::get_list(array('note_id' => $note_id), $limit, $is_latest, $is_desc, $since_id, $max_id, null, false, true);
     // note_like
     $is_liked_self = \Auth::check() ? Model_NoteLike::check_liked($id, $this->u->id) : false;
     $title = array('name' => $note->title);
     $header_info = array();
     if (!$note->is_published) {
         $title['label'] = array('name' => term('form.draft'));
         $header_info = array('body' => sprintf('この%sはまだ公開されていません。', term('note')));
     }
     $ogp_infos = array('title' => $note->title, 'description' => $note->body);
     if ($images) {
         $ogp_infos['image'] = \Site_Util::get_image_uri4image_list($images, 'ai', 'raw');
     }
     $this->set_title_and_breadcrumbs($title, null, $note->member, 'note', $header_info, false, false, $ogp_infos);
     $this->template->subtitle = \View::forge('_parts/detail_subtitle', array('note' => $note));
     $this->template->post_footer = \View::forge('_parts/detail_footer', array('is_mypage' => check_uid($note->member_id)));
     $data = array('note' => $note, 'images' => $images, 'comments' => $list, 'all_comment_count' => $all_comment_count, 'comment_next_id' => $next_id, 'is_liked_self' => $is_liked_self, 'liked_ids' => conf('like.isEnabled') && \Auth::check() && $list ? \Site_Model::get_liked_ids('note_comment', $this->u->id, $list) : array());
     $this->template->content = \View::forge('detail', $data);
 }
예제 #5
0
파일: image.php 프로젝트: uzura8/flockbird
 /**
  * Album image detail
  * 
  * @access  public
  * @params  integer
  * @return  Response
  */
 public function action_detail($id = null)
 {
     $id = (int) $id;
     $album_image = Model_Albumimage::check_authority($id);
     $this->check_browse_authority($album_image->public_flag, $album_image->album->member_id);
     $locations = is_enabled_map('image/detail', 'album') ? Model_AlbumImageLocation::get_locations4album_image_id($id) : null;
     // 既読処理
     if (\Auth::check()) {
         $this->change_notice_status2read($this->u->id, 'album_image', $id);
     }
     // album image_comment
     $default_params = array('latest' => 1);
     list($limit, $is_latest, $is_desc, $since_id, $max_id) = $this->common_get_list_params($default_params, conf('view_params_default.detail.comment.limit_max'));
     list($list, $next_id, $all_comment_count) = Model_AlbumImageComment::get_list(array('album_image_id' => $id), $limit, $is_latest, $is_desc, $since_id, $max_id, null, false, true);
     // album_image_like
     $is_liked_self = \Auth::check() ? Model_AlbumImageLike::check_liked($id, $this->u->id) : false;
     $data = array('album_image' => $album_image, 'locations' => $locations, 'comments' => $list, 'all_comment_count' => $all_comment_count, 'comment_next_id' => $next_id, 'is_liked_self' => $is_liked_self, 'liked_ids' => conf('like.isEnabled') && \Auth::check() && $list ? \Site_Model::get_liked_ids('album_image_comment', $this->u->id, $list) : array());
     // get before and after album_image.id
     if (conf('display_setting.image.detail.displayNextPageButton', 'album')) {
         list($data['before_id'], $data['after_id']) = $this->get_before_after_ids($album_image->id);
     }
     $slide_file_names = array();
     if (conf('display_setting.image.detail.displayGallery.isEnabled', 'album')) {
         if (conf('display_setting.image.detail.displayNextPageButton', 'album')) {
             Model_AlbumImage::clear_cache();
         }
         $slide_file_names = $this->get_slide_file_names($album_image);
     }
     $title = Site_Util::get_album_image_display_name($album_image, term('album_image', 'site.detail'));
     $this->set_title_and_breadcrumbs($title, array('/album/' . $album_image->album_id => $album_image->album->name), $album_image->album->member, 'album', null, false, false, array('title' => $album_image->album->name, 'description' => $album_image->name ?: FBD_SITE_NAME, 'image' => \Site_Util::get_image_uri4image_list($album_image, 'ai', 'raw')));
     $this->template->subtitle = \View::forge('image/_parts/detail_subtitle', array('album_image' => $album_image));
     $this->template->post_header = \View::forge('image/_parts/detail_header');
     $this->template->post_footer = \View::forge('image/_parts/detail_footer', array('album_image' => $album_image, 'locations' => $locations, 'slide_file_names' => $slide_file_names));
     $this->template->content = \View::forge('image/detail', $data);
 }