Пример #1
0
 /**
  * Site index
  * 
  * @access  public
  * @return  Response
  */
 public function action_index()
 {
     $data = array();
     if (Config::get('page.site.index.timeline.isEnabled') && is_enabled('timeline')) {
         $data['timelines'] = \Timeline\Site_Util::get_list4view(\Auth::check() ? $this->u->id : 0, 0, false, null, $this->common_get_list_params(array('desc' => 1, 'latest' => 1, 'limit' => Config::get('page.site.index.timeline.list.limit')), Config::get('page.site.index.timeline.list.limit_max'), true));
         $data['timelines']['see_more_link'] = array('uri' => 'timeline');
         //$this->template->post_footer = \View::forge('timeline::_parts/load_timelines');
     }
     if (Config::get('page.site.index.news.isEnabled') && is_enabled('news')) {
         list($limit, $page) = $this->common_get_pager_list_params(\Config::get('page.site.index.news.list.limit'), \Config::get('page.site.index.news.list.limit_max'));
         $data['news_list'] = \News\Site_Model::get_list($limit, $page, \Auth::check());
         $data['news_list']['see_more_link'] = array('uri' => 'news');
     }
     if (Config::get('page.site.index.albumImage.isEnabled') && is_enabled('album')) {
         list($limit, $page) = $this->common_get_pager_list_params(\Config::get('page.site.index.albumImage.list.limit'), \Config::get('page.site.index.albumImage.list.limit_max'));
         $data['album_images'] = \Album\Model_AlbumImage::get_pager_list(array('related' => array('album'), 'where' => \Site_Model::get_where_params4list(0, \Auth::check() ? $this->u->id : 0), 'order_by' => array('id' => 'desc'), 'limit' => $limit), $page);
         $data['album_images']['liked_album_image_ids'] = conf('like.isEnabled') && \Auth::check() ? \Site_Model::get_liked_ids('album_image', $this->u->id, $data['album_images']['list']) : array();
         $data['album_images']['column_count'] = \Config::get('page.site.index.albumImage.list.column_count');
         //$this->template->post_footer = \View::forge('image/_parts/list_footer');
     }
     $this->template->post_footer = \View::forge('site/_parts/index_footer');
     if (conf('site.index.slide.isEnabled', 'page')) {
         if (conf('site.index.slide.recentAlbumImage.isEnabled', 'page')) {
             $images = \Album\Site_Util::get_top_slide_image_uris();
         } else {
             $images = Config::get('page.site.index.slide.images');
         }
         $this->template->post_header_content = View::forge('site/_parts/slide', array('image_uris' => $images));
     }
     $this->set_title_and_breadcrumbs('', null, null, null, null, true, true);
     $this->template->content = View::forge('site/index', $data);
     if (!empty($data['news_list']['list'])) {
         $this->template->content->set_safe('html_bodys', \News\Site_Model::convert_raw_bodys($data['news_list']['list']));
     }
 }
Пример #2
0
 /**
  * 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);
 }
Пример #3
0
 /**
  * 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);
 }
Пример #4
0
 /**
  * Get list by member
  * 
  * @access  public
  * @param   int  $member_id  target member_id
  * @return  Response (html)
  * @throws  Exception in Controller_Base::controller_common_api
  * @see  Controller_Base::controller_common_api
  */
 public function get_member($member_id = null)
 {
     $this->api_accept_formats = array('html');
     $this->controller_common_api(function () use($member_id) {
         $member_id = \Input::get('member_id', 0) ?: $member_id;
         list($is_mypage, $member) = $member_id ? $this->check_auth_and_is_mypage($member_id, true) : array(null, false);
         list($limit, $page) = $this->common_get_pager_list_params(conf('articles.limit', 'album'), conf('articles.limit_max', 'album'));
         $data = Site_Model::get_album_images($limit, $page, get_uid(), $member, $is_mypage, null, $this->format != 'html');
         $data['liked_album_image_ids'] = conf('like.isEnabled') && \Auth::check() ? \Site_Model::get_liked_ids('album_image', $this->u->id, $data['list']) : array();
         if ($this->format == 'html') {
             if ($member) {
                 $data['member'] = $member;
             }
         } else {
             $list_array = array();
             foreach ($data['list'] as $key => $obj) {
                 $row = $obj->to_array();
                 $row['album']['member'] = \Model_Member::get_one_basic4id($obj->album->member_id);
                 $list_array[] = $row;
             }
             // json response
             $data = $list_array;
         }
         $this->set_response_body_api($data, $this->format == 'html' ? 'image/_parts/list' : null);
     });
 }
Пример #5
0
 /**
  * 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);
 }
Пример #6
0
 /**
  * Get comments common api controller
  * 
  * @access  protected
  * @param   string  $parent_table  target parent table
  * @param   int     $parent_id  target parent record id
  * @param   string  $public_flag_related  related table for check brows authority
  * @param   array   $parent_member_id_relateds  related table and property array for check edit authority
  * @param   int     $limit  record count for get
  * @param   int     $limit_max  record limited count for get
  * @param   string  $parent_id_prop  parent table id property.
  * @return  Response (json|html)
  * @throws  Exception in Controller_Base::controller_common_api
  * @see  Controller_Base::controller_common_api
  */
 protected function api_get_comments_common($parent_table, $parent_id, $public_flag_related = null, $parent_member_id_relateds = array(), $limit = 0, $limit_max = 0, $parent_id_prop = null)
 {
     $this->api_accept_formats = array('json', 'html');
     $this->controller_common_api(function () use($parent_table, $parent_id, $public_flag_related, $parent_member_id_relateds, $limit, $limit_max, $parent_id_prop) {
         $comment_table = $parent_table . '_comment';
         $comment_model = Site_Model::get_model_name($comment_table);
         $parent_id = (int) $parent_id;
         $parent_model = Site_Model::get_model_name($parent_table);
         $parent_obj = $parent_model::check_authority($parent_id, 0, $public_flag_related);
         if (!$parent_id_prop) {
             $parent_id_prop = $parent_table . '_id';
         }
         $auther_member_ids = Util_Orm::get_related_member_ids($parent_obj, $parent_member_id_relateds);
         foreach ($auther_member_ids as $member_id) {
             $this->check_browse_authority($public_flag_related ? $parent_obj->{$public_flag_related}->public_flag : $parent_obj->public_flag, $member_id);
         }
         $member_profile_image_size = Input::get('image_size') ?: 'M';
         if (!in_array($member_profile_image_size, array('SS', 'S', 'M'))) {
             $member_profile_image_size = 'M';
         }
         $default_params = array('latest' => 1, 'limit' => $limit ?: conf('view_params_default.list.comment.limit'));
         list($limit, $is_latest, $is_desc, $since_id, $max_id) = $this->common_get_list_params($default_params, $limit_max ?: conf('view_params_default.list.comment.limit_max'));
         list($list, $next_id, $all_comment_count) = $comment_model::get_list(array($parent_id_prop => $parent_id), $limit, $is_latest, $is_desc, $since_id, $max_id, null, $this->format == 'json', $this->format == 'json');
         if (conf('like.isEnabled')) {
             $liked_ids = \Auth::check() ? \Site_Model::get_liked_ids($comment_table, $this->u->id, $list) : array();
         }
         $api_uri_path_prefix = Site_Model::convert_table2controller_path($parent_table);
         $get_uri = sprintf('%s/comment/api/list/%d.json', $api_uri_path_prefix, $parent_id);
         $data = array('list' => $list, 'parent' => $parent_obj, 'next_id' => $next_id, 'delete_uri' => sprintf('%s/comment/api/delete.json', $api_uri_path_prefix), 'image_size' => $member_profile_image_size);
         if ($since_id) {
             $data['since_id'] = $since_id;
         }
         if ($this->format == 'html') {
             $data += array('auther_member_ids' => $auther_member_ids, 'list_more_box_attrs' => array('id' => 'listMoreBox_comment_' . $parent_id, 'data-uri' => $get_uri, 'data-list' => '#comment_list_' . $parent_id), 'counter_selector' => '#comment_count_' . $parent_id);
             if (conf('like.isEnabled')) {
                 $data['liked_ids'] = $liked_ids;
             }
         } else {
             $data += array('count' => $all_comment_count, 'get_uri' => $get_uri);
             $data['parent'] = array('id' => $parent_id, 'member_id' => $parent_member_id_relateds ? array_shift($auther_member_ids) : $parent_obj->member_id);
             $data['image_size'] = array('key' => $member_profile_image_size, 'value' => conf('upload.types.img.types.m.sizes.' . $member_profile_image_size));
             foreach ($list as $key => $row) {
                 $row['body'] = convert_body($row['body'], array('nl2br' => conf('view_params_default.comment.nl2br'), 'is_truncate' => false, 'mention2link' => true));
                 $row['member'] = Model_Member::get_one_basic4id($row['member_id']);
                 if (conf('like.isEnabled')) {
                     $row['get_like_members_uri'] = sprintf('%s/comment/like/api/member/%d.html', $api_uri_path_prefix, $row['id']);
                     $row['post_like_uri'] = sprintf('%s/comment/like/api/update/%d.json', $api_uri_path_prefix, $row['id']);
                     $row['is_liked'] = \Auth::check() && in_array($row['id'], $liked_ids) ? 1 : 0;
                     $row['comment_table'] = $comment_table;
                 }
                 $list[$key] = $row;
             }
             $data['list'] = $list;
         }
         $this->set_response_body_api($data, $this->format == 'html' ? '_parts/comment/list' : null);
     });
 }
Пример #7
0
 public static function get_list($limit, $page = 1, $self_member_id = 0, $target_member_obj = null, $is_mypage = false, $is_draft = 0)
 {
     if ($target_member_obj && !$target_member_obj instanceof \Model_Member) {
         throw new InvalidArgumentException('forth parameter is invalid.');
     }
     $is_published = \Util_toolkit::reverse_bool($is_draft, true);
     $data = Model_Note::get_pager_list(array('related' => 'member', 'where' => \Site_Model::get_where_params4list($target_member_obj ? $target_member_obj->id : 0, $self_member_id ?: 0, $is_mypage, array(array('is_published', $is_published))), 'limit' => $limit, 'order_by' => array('created_at' => 'desc')), $page);
     $data['is_draft'] = $is_draft;
     $data['member'] = $target_member_obj;
     $data['is_mypage'] = $is_mypage;
     $data['liked_note_ids'] = conf('like.isEnabled') && $self_member_id ? \Site_Model::get_liked_ids('note', $self_member_id, $data['list']) : array();
     return $data;
 }
Пример #8
0
 /**
  * Timeline detail
  * 
  * @access  public
  * @params  integer
  * @return  Response
  */
 public function action_detail($id = null)
 {
     $timeline = Model_Timeline::check_authority($id);
     $this->check_browse_authority($timeline->public_flag, $timeline->member_id);
     // 既読処理
     if (\Auth::check()) {
         $this->change_notice_status2read($this->u->id, 'timeline', $id);
     }
     $liked_timeline_ids = conf('like.isEnabled') && \Auth::check() ? \Site_Model::get_liked_ids('timeline', $this->u->id, array($timeline)) : array();
     list($ogp_title, $ogp_description) = Site_Util::get_timeline_ogp_contents($timeline->type, $timeline->body);
     $this->set_title_and_breadcrumbs(term('timeline', 'site.detail'), null, $timeline->member, 'timeline', null, false, true, array('title' => $ogp_title, 'description' => $ogp_description, 'image' => Site_Util::get_timeline_ogp_image_uri($timeline->type, $timeline->foreign_id, $timeline->id, true)));
     $this->template->post_footer = \View::forge('_parts/load_timelines');
     $this->template->content = \View::forge('_parts/article', array('timeline_id' => $timeline->id, 'type' => $timeline->type, 'member_id' => $timeline->member_id, 'self_member_id' => \Auth::check() ? $this->u->id : 0, 'liked_timeline_ids' => $liked_timeline_ids));
 }
Пример #9
0
 public static function get_album_images($limit, $page = 1, $self_member_id = 0, $target_member_obj = null, $is_mypage = false, $params = array(), $is_return_array = false, $is_asc = false)
 {
     if (!is_array($params)) {
         $params = (array) $params;
     }
     if ($target_member_obj && !$target_member_obj instanceof \Model_Member) {
         throw new InvalidArgumentException('parameter target_member_obj is invalid.');
     }
     if (!empty($params['select']) && !\DBUtil::field_exists('album_image', $params['select'])) {
         throw new \ValidationFailedException();
     }
     $params = array_merge($params, array('where' => \Site_Model::get_where_params4list($target_member_obj ? $target_member_obj->id : 0, $self_member_id ?: 0, $is_mypage, !empty($params['where']) ? $params['where'] : array(), $target_member_obj ? 'album.member_id' : 'member_id'), 'limit' => $limit, 'order_by' => array('id' => $is_asc ? 'asc' : 'desc')));
     if ($target_member_obj) {
         $params['related'] = array('album');
     }
     $data = Model_AlbumImage::get_pager_list($params, $page, $is_return_array);
     $data['liked_album_image_ids'] = conf('like.isEnabled') && $self_member_id ? \Site_Model::get_liked_ids('album_image', $self_member_id, $data['list']) : array();
     return $data;
 }
Пример #10
0
 public static function get_list4view($self_member_id = 0, $target_member_id = 0, $is_mytimeline = false, $viewType = null, $params = array())
 {
     list($list, $next_id) = Site_Model::get_list($self_member_id, $target_member_id, $is_mytimeline, $viewType, $params['max_id'], $params['limit'], $params['is_latest'], $params['is_desc'], $params['since_id']);
     $liked_timeline_ids = conf('like.isEnabled') && $self_member_id ? \Site_Model::get_liked_ids('timeline', $self_member_id, $list) : array();
     $data = array('list' => $list, 'next_id' => $next_id, 'since_id' => $params['since_id'] ?: 0, 'is_display_load_before_link' => $params['max_id'] ? true : false, 'liked_timeline_ids' => $liked_timeline_ids);
     return $data;
 }
Пример #11
0
 /**
  * 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);
 }
Пример #12
0
        $dropdown_btn_attr = array('class' => 'js-dropdown_content_menu', 'data-uri' => sprintf('album/image/api/menu/%d.html', $album_image->id), 'data-member_id' => $album_image->album->member_id, 'data-menu' => '#menu_' . $album_image->id, 'data-loaded' => 0);
        $menus = array(array('icon_term' => 'site.show_detail', 'href' => 'album/image/' . $album_image->id));
        echo btn_dropdown('noterm.dropdown', $menus, false, 'xs', null, true, $dropdown_btn_group_attr, $dropdown_btn_attr, false);
        ?>
		</div><!-- imgBox -->

<?php 
        if (empty($is_simple_view) && $comments) {
            $comment_list_attr = array('class' => 'comment_list list_album_image_comment', 'id' => 'comment_list_' . $album_image->id);
            ?>
		<div <?php 
            echo Util_Array::conv_array2attr_string($comment_list_attr);
            ?>
>
<?php 
            $data = array('parent' => !empty($album) ? $album : $album_image->album, 'list' => $comments, 'next_id' => $comment_next_id, 'uri_for_all_comments' => sprintf('album/image/%d?limit=all#comments', $album_image->id), 'delete_uri' => 'album/image/comment/api/delete.json', 'trim_width' => Config::get('album.articles.comment.trim_width'), 'counter_selector' => '#comment_count_' . $album_image->id, 'list_more_box_attrs' => array('id' => 'listMoreBox_comment_' . $album_image->id, 'data-uri' => sprintf('album/image/comment/api/list/%s.json', $album_image->id), 'data-list' => '#comment_list_' . $album_image->id), 'is_hide_reply_link' => true, 'like_api_uri_prefix' => 'album/image/comment', 'liked_ids' => conf('like.isEnabled') && \Auth::check() && $comments ? \Site_Model::get_liked_ids('album_image_comment', $u->id, $comments) : array());
            echo render('_parts/comment/list', $data);
            ?>
		</div>
<?php 
        }
        ?>
	</div><!-- image_item -->
<?php 
    }
    ?>
</div><!-- image_list -->
</div><!-- row -->
<?php 
}
?>
Пример #13
0
 public static function get_list($limit, $page = 1, $self_member_id = 0)
 {
     $data = Model_Thread::get_pager_list(array('related' => 'member', 'where' => \Site_Model::get_where_params4list(0, $self_member_id), 'limit' => $limit, 'order_by' => array('created_at' => 'desc')), $page);
     $data['liked_thread_ids'] = conf('like.isEnabled') && $self_member_id ? \Site_Model::get_liked_ids('thread', $self_member_id, $data['list']) : array();
     return $data;
 }
Пример #14
0
</div><!-- comment_info -->

<?php 
$comment_get_uri = \Timeline\Site_Util::get_comment_api_uri('get', $timeline->type, $timeline->id, $timeline->foreign_id);
$comment_post_uri = \Timeline\Site_Util::get_comment_api_uri('create', $timeline->type, $timeline->id, $timeline->foreign_id);
$comment_delete_uri = \Timeline\Site_Util::get_comment_api_uri('delete', $timeline->type, $timeline->id, $timeline->foreign_id);
$comment_list_attr = array('class' => 'comment_list unloade_comments', 'id' => 'comment_list_' . $timeline->id, 'data-id' => $timeline->id, 'data-post_uri' => $comment_post_uri, 'data-get_uri' => $comment_get_uri, 'data-get_data' => array('image_size' => 'S'), 'data-input' => '#textarea_comment_' . $timeline->id);
?>
<div <?php 
echo Util_Array::conv_array2attr_string($comment_list_attr);
?>
>
<?php 
if ($is_detail) {
    $data = array('parent' => $timeline, 'list' => $list, 'next_id' => $next_id, 'image_size' => 'S', 'list_more_box_attrs' => array('id' => 'listMoreBox_comment_' . $timeline->id, 'data-uri' => $comment_get_uri, 'data-list' => '#comment_list_' . $timeline->id, 'data-template' => '#comment-template', 'data-is_before' => 1), 'delete_uri' => $comment_delete_uri, 'counter_selector' => '#comment_count_' . $timeline->id, 'absolute_display_delete_btn' => true, 'like_api_uri_prefix' => 'timeline/comment', 'liked_ids' => conf('like.isEnabled') && \Auth::check() ? \Site_Model::get_liked_ids('timeline_comment', $u->id, $list) : array());
    echo render('_parts/comment/list', $data);
}
?>
</div>

<?php 
$link_comment_attr = array('class' => 'link_show_comment_form showCommentBox', 'id' => 'link_show_comment_form_' . $timeline->id, 'data-id' => $timeline->id, 'data-block' => 'form_comment_' . $timeline->id);
if (!$is_detail) {
    $link_comment_attr['class'] .= ' hidden';
}
if (!$is_detail || $list) {
    echo anchor('#', term('form.do_comment'), false, $link_comment_attr);
}
?>
Пример #15
0
                echo render('_parts/services/share', array('uri' => 'note/' . $id, 'text' => $note->title));
            }
            ?>

</div><!-- .comment_info -->

<?php 
            $comment_list_attr = array('class' => 'comment_list', 'id' => 'comment_list_' . $id);
            if ($comments) {
                ?>
<div <?php 
                echo Util_Array::conv_array2attr_string($comment_list_attr);
                ?>
>
<?php 
                $data = array('parent' => $note, 'list' => $comments, 'next_id' => $comment_next_id, 'delete_uri' => 'note/comment/api/delete.json', 'counter_selector' => '#comment_count_' . $id, 'list_more_box_attrs' => array('id' => 'listMoreBox_comment_' . $id, 'data-uri' => sprintf('note/comment/api/list/%s.json', $id), 'data-list' => '#comment_list_' . $id, 'data-template' => '#comment-template'), 'like_api_uri_prefix' => 'note/comment', 'liked_ids' => conf('like.isEnabled') && \Auth::check() ? \Site_Model::get_liked_ids('note_comment', $u->id, $comments) : array());
                echo render('_parts/comment/list', $data);
                ?>
</div>

<?php 
                /* post_comment_link */
                if (Auth::check()) {
                    $link_comment_attr['class'] .= ' showCommentBox';
                    echo anchor('#', term('form.do_comment'), false, $link_comment_attr);
                }
                ?>

<?php 
            } else {
                ?>