echo 'checked="checked" '; } ?> /> <label for="show_expiry_all"><?php echo T_('All comments'); ?> </label> </div> <?php } load_funcs('comments/model/_comment_js.funcs.php'); // comments_container value shows, current Item ID echo '<div id="comments_container" value="' . $Item->ID . '">'; // display comments $CommentList->display_if_empty(array('before' => '<div class="bComment"><p>', 'after' => '</p></div>', 'msg_empty' => T_('No feedback for this post yet...'))); require $inc_path . 'comments/views/_comment_list.inc.php'; echo '</div>'; // comments_container div if ($Item->can_comment()) { // User can leave a comment ?> <!-- ========== FORM to add a comment ========== --> <h4><?php echo T_('Leave a comment'); ?> :</h4> <?php $Form = new Form($htsrv_url . 'comment_post.php', 'comment_checkchanges'); $Form->begin_form('bComment');
* * b2evolution - {@link http://b2evolution.net/} * Released under GNU GPL License - {@link http://b2evolution.net/about/gnu-gpl-license} * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/} * * @package evoskins */ if (!defined('EVO_MAIN_INIT')) { die('Please, do not access this page directly.'); } $CommentList = new CommentList2($Blog); // Filter list: $CommentList->set_filters(array('types' => array('comment', 'trackback', 'pingback'), 'statuses' => get_inskin_statuses($Blog->ID, 'comment'), 'order' => 'DESC', 'comments' => $Blog->get_setting('latest_comments_num'))); // Get ready for display (runs the query): $CommentList->display_init(); $CommentList->display_if_empty(array('msg_empty' => T_('No replies yet...'))); if ($CommentList->result_num_rows > 0) { ?> <table class="bForums fixed_layout evo_content_block" width="100%" cellspacing="1" cellpadding="2" border="0"> <tr> <th class="col1"><?php echo T_('Author'); ?> </th> <th><?php echo T_('Message'); ?> </th> </tr> <?php while ($Comment =& $CommentList->get_next()) {
/** * Display CommentList with the given filters * * @param integer Blog ID * @param integer Item ID * @param array Status filters * @param integer Limit * @param array Comments IDs string to exclude from the list * @param string Filterset name * @param string Expiry status: 'all', 'active', 'expired' */ function echo_item_comments($blog_ID, $item_ID, $statuses = NULL, $currentpage = 1, $limit = 20, $comment_IDs = array(), $filterset_name = '', $expiry_status = 'active') { global $inc_path, $status_list, $Blog, $admin_url; $BlogCache =& get_BlogCache(); $Blog =& $BlogCache->get_by_ID($blog_ID, false, false); global $CommentList; $CommentList = new CommentList2($Blog, $limit, 'CommentCache', '', $filterset_name); $exlude_ID_list = NULL; if (!empty($comment_IDs)) { $exlude_ID_list = '-' . implode(",", $comment_IDs); } if (empty($statuses)) { $statuses = get_visibility_statuses('keys', array('redirected', 'trash')); } if ($expiry_status == 'all') { // Display all comments $expiry_statuses = array('active', 'expired'); } else { // Display active or expired comments $expiry_statuses = array($expiry_status); } // if item_ID == -1 then don't use item filter! display all comments from current blog if ($item_ID == -1) { $item_ID = NULL; } // set redirect_to if ($item_ID != null) { // redirect to the items full view param('redirect_to', 'url', url_add_param($admin_url, 'ctrl=items&blog=' . $blog_ID . '&p=' . $item_ID, '&')); param('item_id', 'integer', $item_ID); param('currentpage', 'integer', $currentpage); if (count($statuses) == 1) { $show_comments = $statuses[0]; } else { $show_comments = 'all'; } param('comments_number', 'integer', generic_ctp_number($item_ID, 'comments', $show_comments)); // Filter list: $CommentList->set_filters(array('types' => array('comment', 'trackback', 'pingback'), 'statuses' => $statuses, 'expiry_statuses' => $expiry_statuses, 'comment_ID_list' => $exlude_ID_list, 'post_ID' => $item_ID, 'order' => 'ASC', 'comments' => $limit, 'page' => $currentpage)); } else { // redirect to the comments full view param('redirect_to', 'url', url_add_param($admin_url, 'ctrl=comments&blog=' . $blog_ID . '&filter=restore', '&')); // this is an ajax call we always have to restore the filterst (we can set filters only without ajax call) $CommentList->set_filters(array('types' => array('comment', 'trackback', 'pingback'))); $CommentList->restore_filterset(); } // Get ready for display (runs the query): $CommentList->display_init(); $CommentList->display_if_empty(array('before' => '<div class="bComment"><p>', 'after' => '</p></div>', 'msg_empty' => T_('No feedback for this post yet...'))); // display comments require $inc_path . 'comments/views/_comment_list.inc.php'; }
* * @package evoskins */ if (!defined('EVO_MAIN_INIT')) { die('Please, do not access this page directly.'); } // Default params: $params = array_merge(array('comment_template' => '_item_comment.inc.php', 'author_link_text' => 'name', 'link_to' => 'userurl>userpage', 'display_comment_avatar' => true, 'comment_avatar_position' => 'before_title', 'comment_start' => '<article class="evo_comment evo_content_block panel panel-default">', 'comment_end' => '</article></div>', 'comment_post_display' => true, 'comment_post_before' => '<div><h4 class="evo_comment_title panel-title">', 'comment_post_after' => '</h4>', 'comment_title_before' => '<h4 class="evo_comment_title panel-title">', 'comment_title_after' => '</h4></div><div class="panel-body">', 'comment_avatar_before' => '<div class="comments-wrapper"><div class="evo_comment_avatar">', 'comment_avatar_after' => '</div>', 'comment_rating_before' => '<div class="evo_comment_rating">', 'comment_rating_after' => '</div>', 'comment_text_before' => '<div class="evo_comment_text">', 'comment_text_after' => '</div>', 'comment_info_before' => '<footer class="evo_comment_info clear text-muted"><small>', 'comment_info_after' => '</small></footer></div>', 'comment_image_size' => 'fit-1280x720', 'comment_image_class' => 'img-responsive'), $params); $CommentList = new CommentList2($Blog); // Filter list: $CommentList->set_filters(array('types' => array('comment', 'trackback', 'pingback'), 'statuses' => get_inskin_statuses($Blog->ID, 'comment'), 'order' => 'DESC', 'comments' => $Blog->get_setting('latest_comments_num'))); // Run SQL query to get results depending on current filters: $CommentList->query(); // Get ready for display (runs the query): $CommentList->display_init(); $CommentList->display_if_empty(); echo '<div class="evo_content_block">'; while ($Comment =& $CommentList->get_next()) { // Loop through comments: ?> <!-- ========== START of a COMMENT ========== --> <?php // ------------------ COMMENT INCLUDED HERE ------------------ skin_include($params['comment_template'], array('Comment' => &$Comment, 'comment_start' => $params['comment_start'], 'comment_end' => $params['comment_end'], 'comment_post_display' => $params['comment_post_display'], 'comment_post_before' => $params['comment_post_before'], 'comment_post_after' => $params['comment_post_after'], 'comment_title_before' => $params['comment_title_before'], 'comment_title_after' => $params['comment_title_after'], 'comment_avatar_before' => $params['comment_avatar_before'], 'comment_avatar_after' => $params['comment_avatar_after'], 'comment_rating_before' => $params['comment_rating_before'], 'comment_rating_after' => $params['comment_rating_after'], 'comment_text_before' => $params['comment_text_before'], 'comment_text_after' => $params['comment_text_after'], 'comment_info_before' => $params['comment_info_before'], 'comment_info_after' => $params['comment_info_after'], 'author_link_text' => $params['author_link_text'], 'link_to' => $params['link_to'], 'author_link_text' => $params['author_link_text'], 'image_size' => $params['comment_image_size'], 'image_class' => $params['comment_image_class'])); // Note: You can customize the default item comment by copying the generic // /skins/_item_comment.inc.php file into the current skin folder. // ---------------------- END OF COMMENT --------------------- ?> <!-- ========== END of a COMMENT ========== --> <?php }
?> <!-- Title for comments, tbs, pbs... --> <h4><?php echo implode(", ", $disp_title); ?> :</h4> <?php $comments_per_page = !$Blog->get_setting('threaded_comments') ? $Blog->get_setting('comments_per_page') : 1000; $CommentList = new CommentList2($Blog, $comments_per_page); // Filter list: $CommentList->set_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'))); // Get ready for display (runs the query): $CommentList->display_init(); $CommentList->display_if_empty(array('msg_empty' => sprintf(T_('No %s for this post yet...'), implode("/", $disp_title)))); if ($Blog->get_setting('threaded_comments')) { // Array to store the comment replies global $CommentReplies; $CommentReplies = array(); } while ($Comment =& $CommentList->get_next()) { // Loop through comments: if ($Blog->get_setting('threaded_comments') && $Comment->in_reply_to_cmt_ID > 0) { // Store the replies in a special array if (!isset($CommentReplies[$Comment->in_reply_to_cmt_ID])) { $CommentReplies[$Comment->in_reply_to_cmt_ID] = array(); } $CommentReplies[$Comment->in_reply_to_cmt_ID][] = $Comment; continue; // Skip dispay a comment reply here in order to dispay it after parent comment by function display_comment_replies()