/**
  * Display the widget!
  *
  * @param array MUST contain at least the basic display params
  */
 function display($params)
 {
     global $Blog;
     $this->init_display($params);
     $blog_ID = intval($this->disp_params['blog_ID']);
     $blogCache =& get_BlogCache();
     $listBlog = $blog_ID ? $blogCache->get_by_ID($blog_ID) : $Blog;
     // Create ItemList
     // Note: we pass a widget specific prefix in order to make sure to never interfere with the mainlist
     $limit = intval($this->disp_params['limit']);
     $order = $this->disp_params['disp_order'];
     $CommentList = new CommentList2($listBlog, $limit, 'CommentCache', $this->code . '_');
     $filters = array('types' => array('comment', 'trackback', 'pingback'), 'statuses' => array('published'), 'order' => $order, 'comments' => $limit);
     if (isset($this->disp_params['page'])) {
         $filters['page'] = $this->disp_params['page'];
     }
     // Filter list:
     $CommentList->set_filters($filters);
     // Get ready for display (runs the query):
     $CommentList->display_init();
     echo $this->disp_params['block_start'];
     // Display title if requested
     $this->disp_title();
     echo $this->disp_params['block_body_start'];
     echo $this->disp_params['list_start'];
     if (empty($this->disp_params['author_link_text'])) {
         $this->disp_params['author_link_text'] = 'login';
     }
     /**
      * @var Comment
      */
     while ($Comment =& $CommentList->get_next()) {
         // Loop through comments:
         // Load comment's Item object:
         $Comment->get_Item();
         echo $this->disp_params['item_start'];
         $Comment->author('', ' ', '', ' ', 'htmlbody', $this->disp_params['author_links'], $this->disp_params['author_link_text']);
         echo T_('on ');
         $Comment->permanent_link(array('text' => $Comment->Item->title, 'title' => $this->disp_params['hover_text']));
         echo $this->disp_params['item_end'];
     }
     // End of comment loop.}
     if (isset($this->disp_params['page'])) {
         if (empty($this->disp_params['pagination'])) {
             $this->disp_params['pagination'] = array();
         }
         $CommentList->page_links($this->disp_params['pagination']);
     }
     echo $this->disp_params['list_end'];
     echo $this->disp_params['block_body_end'];
     echo $this->disp_params['block_end'];
     return true;
 }
Ejemplo n.º 2
0
 if (empty($disp_title)) {
     // Still no title
     $disp_title[] = T_('No feedback yet');
 }
 $comments_per_page = !$Blog->get_setting('threaded_comments') ? $Blog->get_setting('comments_per_page') : 1000;
 $CommentList = new CommentList2($Blog, $comments_per_page, 'CommentCache', 'c_');
 // Filter list:
 $CommentList->set_default_filters(array('types' => $type_list, 'statuses' => NULL, 'post_ID' => $Item->ID, 'order' => $Blog->get_setting('comments_orderdir'), 'threaded_comments' => $Blog->get_setting('threaded_comments')));
 $CommentList->load_from_Request();
 // Get ready for display (runs the query):
 $CommentList->display_init();
 // Set redir=no in order to open comment pages
 memorize_param('redir', 'string', '', 'no');
 if ($Blog->get_setting('paged_comments')) {
     // Prev/Next page navigation
     $CommentList->page_links(array('page_url' => url_add_tail($Item->get_permanent_url(), '#comments')));
 }
 if ($Blog->get_setting('threaded_comments')) {
     // Array to store the comment replies
     global $CommentReplies;
     $CommentReplies = array();
     if ($Comment = $Session->get('core.preview_Comment')) {
         // Init PREVIEW comment
         if ($Comment->item_ID == $Item->ID) {
             $CommentReplies[$Comment->in_reply_to_cmt_ID] = array($Comment);
             // Change the styles for preview comment
             $params['before_section_title'] = '<h3 id="com-head" onclick="bnc_showhide_coms_toggle();" class="comhead-open"><img alt="arrow" src="' . $Skin->get_url() . 'img/com_arrow.png" id="com-arrow" class="com-arrow-down" />';
             $params['comment_list_start'] = '<ol id="commentlist" class="commentlist" style="display:block">';
             $params['preview_start'] = '<li id="comment_preview"><div class="comwrap">';
             $params['preview_end'] = '</div></li>';
         }
Ejemplo n.º 3
0
 $comments_per_page = !$Blog->get_setting('threaded_comments') ? $Blog->get_setting('comments_per_page') : 1000;
 $CommentList = new CommentList2($Blog, $comments_per_page, 'CommentCache', 'c_');
 // Filter list:
 $CommentList->set_default_filters(array('types' => $type_list, 'statuses' => get_inskin_statuses($Blog->ID, 'comment'), 'post_ID' => $Item->ID, 'order' => $Blog->get_setting('comments_orderdir'), 'threaded_comments' => $Blog->get_setting('threaded_comments')));
 $CommentList->load_from_Request();
 // Get ready for display (runs the query):
 $CommentList->display_init();
 // Set redir=no in order to open comment pages
 memorize_param('redir', 'string', '', 'no');
 if ($params['nav_top_inside']) {
     // To use comments page navigation inside list (Useful for table markup)
     echo $params['comment_list_start'];
 }
 if ($params['disp_nav_top'] && $Blog->get_setting('paged_comments')) {
     // Prev/Next page navigation
     $CommentList->page_links(array_merge(array('page_url' => url_add_tail($Item->get_permanent_url(), '#comments'), 'block_start' => $params['nav_block_start'], 'block_end' => $params['nav_block_end'], 'prev_text' => $params['nav_prev_text'], 'next_text' => $params['nav_next_text'], 'prev_class' => $params['nav_prev_class'], 'next_class' => $params['nav_next_class']), $params['pagination']));
 }
 if ($Blog->get_setting('threaded_comments')) {
     // Array to store the comment replies
     global $CommentReplies;
     $CommentReplies = array();
     if ($Comment = $Session->get('core.preview_Comment')) {
         // Init PREVIEW comment
         if ($Comment->item_ID == $Item->ID) {
             $CommentReplies[$Comment->in_reply_to_cmt_ID] = array($Comment);
         }
     }
 }
 if (!$params['nav_top_inside']) {
     // To use comments page navigation before list
     echo $params['comment_list_start'];