Ejemplo n.º 1
0
 function disp_feedback_list($type = 'comment', $params = array())
 {
     global $Blog, $Item, $app_version;
     $type_list = array($type);
     if (version_compare($app_version, '4.0') < 0) {
         // b2evo 3
         //array_walk($type_list, function(&$v){ $v = "'$v'"; });
         foreach ($type_list as $v) {
             $type_list_fixed[] = "'{$v}'";
         }
         $CommentList = new CommentList(NULL, implode(',', $type_list_fixed), array('published'), $Item->ID, '', 'ASC');
     } else {
         // b2evo 4
         $type = substr($type, 0, 1);
         $CommentList = new CommentList2($Blog, $Blog->get_setting('comments_per_page'), 'CommentCache', $type . '_');
         // Filter list:
         $CommentList->set_default_filters(array('types' => $type_list, 'statuses' => array('published'), 'post_ID' => $Item->ID, 'order' => $Blog->get_setting('comments_orderdir')));
         $CommentList->load_from_Request();
         // Get ready for display (runs the query):
         $CommentList->display_init();
     }
     if ($CommentList->result_num_rows < 1) {
         return;
     }
     forget_param('c');
     forget_param('tb');
     forget_param('pb');
     forget_param('disp');
     forget_param('more');
     forget_param('title');
     if (method_exists($CommentList, 'page_links') && $Blog->get_setting('paged_comments')) {
         // Navigation
         $CommentList->page_links(array('page_url' => url_add_tail($Item->get_permanent_url(), '#post-tabs'), 'block_start' => '<div class="comment-navigation clearfix">', 'block_end' => '</div>', 'prev_text' => '&laquo;', 'next_text' => '&raquo;'));
         $nav_displayed = 1;
     }
     echo $params['comment_list_start'];
     while ($Comment =& $CommentList->get_next()) {
         // Loop through comments:
         // ------------------ COMMENT INCLUDED HERE ------------------
         skin_include($params['comment_template'], array('Comment' => &$Comment, 'comment_start' => $params['comment_start'], 'comment_end' => $params['comment_end'], 'link_to' => $params['link_to']));
         // ---------------------- END OF COMMENT ---------------------
     }
     // End of comment list loop.
     echo $params['comment_list_end'];
     if (!empty($nav_displayed)) {
         // Navigation
         $CommentList->page_links(array('page_url' => url_add_tail($Item->get_permanent_url(), '#post-tabs'), 'block_start' => '<div class="comment-navigation clearfix">', 'block_end' => '</div>', 'prev_text' => '&laquo;', 'next_text' => '&raquo;'));
     }
 }
Ejemplo n.º 2
0
 if ($params['disp_comments'] || $params['disp_trackbacks'] || $params['disp_pingbacks']) {
     if (empty($disp_title)) {
         // No title yet
         if ($title = $Item->get_feedback_title('feedbacks', '', T_('Feedback awaiting moderation'), T_('Feedback awaiting moderation'), array('review', 'draft'), false)) {
             // We have some feedback awaiting moderation: we'll want to show that in the title
             $disp_title[] = $title;
         }
     }
     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
Ejemplo n.º 3
0
 $AdminUI->append_path_level('comments');
 if (empty($tab3)) {
     $tab3 = 'fullview';
 }
 $AdminUI->set_path('collections', 'comments', $tab3);
 $comments_list_param_prefix = 'cmnt_';
 if (!empty($tab3)) {
     // Use different param prefix for each tab
     $comments_list_param_prefix .= $tab3 . '_';
 }
 /*
  * List of comments to display:
  */
 $CommentList = new CommentList2($Blog, NULL, 'CommentCache', $comments_list_param_prefix, $tab3);
 // Filter list:
 $CommentList->set_default_filters(array('statuses' => get_visibility_statuses('keys', array('redirected', 'trash')), 'order' => 'DESC'));
 $CommentList->load_from_Request();
 /**
  * Mass delete comments
  */
 param('mass_type', 'string', '');
 if ($action == 'mass_delete' && !empty($mass_type)) {
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('comment');
     // Init the comment list query, but don't execute it
     $CommentList->query_init();
     // Set sql query to get deletable comment ids
     $deletable_comments_query = 'SELECT DISTINCT ' . $CommentList->Cache->dbIDname . ' ' . $CommentList->CommentQuery->get_from() . $CommentList->CommentQuery->get_where();
     // Set an action param to display a correct template
     $process_action = $action;
     unset($_POST['actionArray']);