wp_list_comments(array('type' => commenting_by_type() ? 'comment' : 'all', 'callback' => 'spec_comment_layout')); if ($order != 'desc') { spec_comments_form(); } ?> </ul> <div id="comment-pagination"> <?php paginate_comments_links(array('next_text' => '»', 'prev_text' => '«')); ?> </div> <?php // Trackbacks if apart from comments. if (commenting_by_type() && ($comments_by_type['pingback'] || $comments_by_type['trackback'])) { if (spec_comment_option('trackback') != '') { echo '<div class="comment-title">' . spec_comment_option('trackback') . '</div>'; } ?> <ul id="trackback-list"> <?php wp_list_comments(array('per_page' => -1, 'max_depth' => 0, type => 'pings', 'callback' => 'spec_comment_layout')); ?> </ul> <?php } } ?> </div><?php }
function check_live($post_ID = 0) { $post_ID = intval($post_ID); $post_meta = intval(get_post_meta($post_ID, '_' . SPEC_COMMENT_OPT . '_live', true)); $post_status = $post_meta === 10 ? false : ($post_meta === 20 ? true : null); $glob_status = spec_comment_option('update'); return is_bool($post_status) ? $post_status : $glob_status; }
function spec_comment_layout($comment, $args = array(), $depth = null) { global $post; $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); if (!(isset($post) && is_object($post)) && (isset($post_id) && intval($post_id))) { $post = get_post($post_id); } if (!isset($max_depth)) { $max_depth = get_option('thread_comments_depth'); } $add_below = 'comment'; $tb = $comment->comment_type == 'trackback' || $comment->comment_type == 'pingback'; // Avatar ( Still in glorious 2D :P ) if (get_option('show_avatars') && $avatar_size != 0) { $avatar = get_avatar($comment, $depth == 1 ? apply_filters('spec_avatar_size_large', 64) : apply_filters('spec_avatar_size_small', 32)); } ?> <li id="comment-<?php comment_ID(); ?> " <?php echo comment_class(!empty($avatar) ? 'with-avatar' : '', get_comment_ID(), null, false); ?> > <div id="div-comment-<?php comment_ID(); ?> " class="comment-body"> <?php //echo $comment->comment_date; ?> <?php echo !empty($avatar) && !$tb ? '<div class="comment-author-avatar">' . $avatar . '<span class="avatar-overlay"></span></div>' : ''; ?> <div class="comment-content"> <div class="comment-meta"> <cite class="fn"><?php comment_author_link(); ?> </cite> <span class="date"><?php printf(__('%1$s at %2$s', SPEC_COMMENT_DOM), get_comment_date(), get_comment_time()); ?> </span> </div> <div class="comment-text"> <?php comment_text(); if ($comment->comment_approved == 0) { // comment is awaiting approval! ?> <span class="moderation"> <?php echo __('Comment awaiting moderation.', SPEC_COMMENT_DOM); if (current_user_can('moderate_comments')) { ?> <div class="moderation-buttons"> <a class="spec_moderation_button_approve" data-comment="<?php echo get_comment_ID(); ?> " href="<?php echo spec_comment_approve_link($post->ID, get_comment_ID()); ?> ">Approve</a> <a class="spec_moderation_button_delete" data-comment="<?php echo get_comment_ID(); ?> " href="<?php echo spec_comment_delete_link($post->ID, get_comment_ID()); ?> ">Delete</a> <a class="spec_moderation_button_spam" data-comment="<?php echo get_comment_ID(); ?> " href="<?php echo spec_comment_spam_link($post->ID, get_comment_ID()); ?> ">Spam</a> </div> <?php } ?> </span> <?php } ?> </div> <?php if (!$tb) { ?> <div class="comment-buttons"><?php comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $max_depth, 'reply_text' => __('Reply', SPEC_COMMENT_DOM))), null, isset($args['post_id']) && intval($args['post_id']) ? intval($args['post_id']) : null); edit_comment_link(__('Edit', SPEC_COMMENT_DOM), '', ''); if (spec_comment_option('link_button')) { ?> <a class="comment-button comment-link" href="<?php echo htmlspecialchars(get_comment_link()); ?> "><?php _e('Link', SPEC_COMMENT_DOM); ?> </a><?php } ?> </div><?php } ?> </div> </div> <?php }