function format_comment($comment, $args, $depth) { echo '<div '; comment_class(); echo ' id="li-comment-'; comment_ID(); echo '"> <div class="row-fluid"> <div class="span9"> <p>'; comment_text(); echo '</p> </div> <div class="span3">'; echo get_avatar($comment->comment_author_email, 60); echo '<h6> <a href="'; comment_author_url(); echo '">'; comment_author(); echo '</a> </h6> <small>'; printf(__('%1$s', DOMAIN), get_comment_date(), get_comment_time()); echo '</small> </div> </div> </div>'; }
function edu7_comment($comment, $args, $depth) { ?> <div class="comment-img"><?php echo get_avatar($comment, $size = '45'); ?> </div> <div class="comments-box"> <?php comment_text(); ?> <?php if ($comment->comment_approved == '0') { ?> <em><?php _e('Your comment is awaiting moderation.'); ?> </em> <?php } ?> <br/><span class="comment-writer"> توسط <?php comment_author(); ?> </span><span class="comment-date"><?php comment_date(); ?> - <?php comment_time(); ?> </span> <?php comment_reply_link(array_merge($args, array('before' => '<span class="comment-replay">', 'reply_text' => 'پاسخ', 'after' => '</span>', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div><br/><?php }
public function start_el(&$output, $comment, $depth = 0, $args = array(), $id = 0) { $depth++; $GLOBALS['comment_depth'] = $depth; $GLOBALS['comment'] = $comment; $parent_class = empty($args['has_children']) ? '' : 'parent'; ?> <li id="comment-<?php comment_ID(); ?> " <?php comment_class($parent_class); ?> > <div class="comment-header"> <div class="left"> <ul class="c"> <li class="author"> <a href="<?php comment_author_url(); ?> "> <?php comment_author(); ?> </a> </li> <li class="date"> <?php comment_time(get_option('n/j/Y g:i A')); ?> </li> </ul> </div> <div class="right"> <ul class="c"> <li class="reply"> <?php $reply_args = array('depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => '<span data-icon="reply"></span>'); comment_reply_link(array_merge($args, $reply_args)); ?> </li> <li class="edit"> <?php edit_comment_link('<span data-icon="edit"></span>'); ?> </li> </ul> </div> </div> <section class="comment-body"> <?php comment_text(); ?> </section> <?php }
function quality_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; //get theme data global $comment_data; //translations $leave_reply = $comment_data['translation_reply_to_coment'] ? $comment_data['translation_reply_to_coment'] : __('Reply', 'quality'); ?> <div class="media qua_comment_box"> <a class="pull_left_comment"> <?php echo get_avatar($comment, $size = '60'); ?> </a> <div class="media-body"> <div class="qua_comment_detail"> <h4 class="qua_comment_detail_title"><?php comment_author($comment); ?> </h4> <span class="qua_comment_date"><?php comment_date('F j, Y'); ?> <?php _e('at', 'quality'); ?> <?php comment_time('g:i a'); ?> </span> <?php comment_text(); ?> <div class="reply"> <i class="fa fa-mail-reply"></i> <?php comment_reply_link(array_merge($args, array('reply_text' => $leave_reply, 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> <?php if ($comment->comment_approved == '0') { ?> <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.', 'quality'); ?> </em> <br/> <?php } ?> </div> </div> </div> <?php }
function advanced_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <div class="comment-container" id="comment-<?php comment_ID(); ?> "> <div class="gravatar"> <?php echo get_avatar($comment); ?> </div> <span class="comment-author"> <?php echo get_comment_author_link(); ?> 说道: </span> <div class="comment-time"> <?php echo get_comment_date(); echo get_comment_time(); ?> <span class="edit-comment"><?php edit_comment_link('修改'); ?> </span> </div> <div class="comment-content"> <?php echo comment_text(); ?> </div> <div class="comment-reply" onclick="replyComment(<?php echo $comment->comment_post_ID; ?> ,<?php echo $comment->comment_ID; ?> ,'<?php echo get_option('siteurl'); ?> '+'/wp-comments-post.php','<?php echo comment_author(); ?> ','<?php echo comment_author_email(); ?> ','<?php echo comment_author_url(); ?> ')"> 回复 </div> </div> <?php }
function custom_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <?php switch ($comment->comment_type) { case 'pingback': case 'trackback': ?> <li <?php comment_class('comments-item'); ?> id="comment<?php comment_ID(); ?> "> <div class="back-link">< ?php comment_author_link(); ?></div> <?php break; default: ?> <li <?php comment_class('comments-item'); ?> id="comment-<?php comment_ID(); ?> "> <div class="comments-item-pic"> <?php echo get_avatar($comment, 60); ?> </div> <div class="comments-item-comment"> <p class="info"><span class="name"><?php comment_author(); ?> </span> <span class="timestamp"><?php echo human_time_diff(strtotime($comment->comment_date_gmt), current_time('timestamp')) . ' ago'; ?> </span> <?php comment_reply_link(array_merge($args, array('reply_text' => 'Reply', 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </p> <p><?php echo $comment->comment_content; ?> </p> </div> <hr ?> <?php // End the default styling of comment break; } }
function gt_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li class="comment"> <div> <?php echo get_avatar($comment, $size = '50'); ?> <div class="comment-meta"> <h5 class="author"><a href="<?php comment_author_url(); ?> " target="about_blank"><?php comment_author(); ?> </a> - <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </h5> <p class="date"><?php printf(__('%1$s at %2$s', 'velocityslide'), get_comment_date(), get_comment_time()); ?> </p> </div> <div class="comment-entry"> <?php comment_text(); ?> </div> </div> <?php if ($comment->comment_approved == '0') { ?> <em class="comment-moderate"><?php _e('Your comment is awaiting moderation.', 'velocityslide'); ?> </em> <br /> <?php } ?> <?php edit_comment_link(__('(Edit)', 'velocityslide'), ' ', ''); ?> <?php }
function weblizar_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; //get theme data global $comment_data; //translations $leave_reply = $comment_data['translation_reply_to_coment'] ? $comment_data['translation_reply_to_coment'] : __('Reply', 'weblizar'); ?> <div class="comment_wrap"> <div class="gravatar"> <?php echo get_avatar($comment, $size = '60'); ?> </div> <div class="comment_content"> <div class="comment_meta"> <div class="comment_author"><?php comment_author(); ?> </div> </div> <div class="comment_text"> <?php comment_text(); ?> <a href=""><?php comment_reply_link(array_merge($args, array('reply_text' => $leave_reply, 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </a> </div> </div> <?php if ($comment->comment_approved == '0') { ?> <div id="div2" class="info"> <div class="message-box-wrap"> <button class="close-but" id="colosebut2"><?php _e('close', 'weblizar'); ?> </button> <?php _e('Your comment is awaiting moderation.', 'weblizar'); ?> </div> </div> <br/> <?php } ?> </div> <?php }
function comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <div class="comment-container"> <div class="comment-post" <?php comment_class(); ?> id="comment-<?php comment_ID(); ?> "> <div class="avatar"><?php echo get_avatar($comment, $size = '54'); ?> </div> <div class="author"> <div class="comment-author"><?php comment_author(); ?> </div> <div class="comment-info"><u><?php _e('posted on', GETTEXT_DOMAIN); ?> <?php echo esc_html(get_comment_date()); ?> </u> <?php edit_comment_link(__('Edit', GETTEXT_DOMAIN), '', ''); ?> <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> <?php if ($comment->comment_approved == '0') { ?> <p class="comment-content"><em class="moderation"><?php _e('Your comment is awaiting moderation.', GETTEXT_DOMAIN); ?> </em></p> <?php } ?> <div class="comment-content"><?php comment_text(); ?> </div> </div> <div class=" clearfix"></div> </div> <?php }
function mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <div class="comment" id="comment-<?php comment_ID(); ?> "> <a class="gravatar"> <?php echo get_avatar($comment, $size = '120'); ?> </a> <?php if ($comment->comment_approved == '0') { ?> <em>Your comment is awaiting moderation.</em> <?php } ?> <p class="comment-date"> <a href="#comment-<?php comment_ID(); ?> " title=""><?php comment_date('F jS, Y'); ?> on <?php comment_time(); ?> </a> <small><?php edit_comment_link('edit', ' ', ''); ?> </small> </p> <p><strong><?php comment_author(); ?> </strong> said:</p> <?php comment_text(); ?> <div class="clear"></div> <div class="reply"> <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> <?php }
/** * Custom column to render comment authors * * @param Object $comment Current comment */ public function column_author($comment) { ?> <strong><?php comment_author(); ?> </strong><br /> <?php $author_url = get_comment_author_url(); if (preg_match('|^https?://$|', $author_url)) { $author_url = ''; } // END if $author_url_display = preg_replace('|https?://(www\\.)?|i', '', $author_url); if (strlen($author_url_display) > 50) { $author_url_display = substr($author_url_display, 0, 49) . '…'; } // END if if (!empty($author_url)) { ?> <a href="<?php echo esc_url($author_url); ?> " title="<?php echo esc_url($author_url); ?> "><?php esc_html($author_url_display); ?> </a> <?php } // END if if ($this->user_can) { if (!empty($comment->comment_author_email)) { comment_author_email_link(); } // END if $args = array('s' => get_comment_author_IP(), 'mode' => 'detail'); ?> <br /> <a href="<?php echo esc_url(add_query_arg($args, admin_url('edit-comments.php'))); ?> "><?php echo esc_html(get_comment_author_IP()); ?> </a> <?php } // END if }
function start_el(&$output, $comment, $depth = 0, $args = array(), $id = 0) { $depth++; $GLOBALS['comment_depth'] = $depth; $GLOBALS['comment'] = $comment; $parent_class = empty($args['has_children']) ? '' : 'parent'; if ('article' == $args['style']) { $tag = 'article'; $add_below = 'comment'; } else { $tag = 'article'; $add_below = 'comment'; } ?> <ul class="comments-list"> <li class="comment comment-line" <?php comment_class("single-comment clearfix col-md-12", empty($args['has_children']) ? '' : 'parent'); ?> id="comment-<?php comment_ID(); ?> " itemscope itemtype="http://schema.org/Comment"> <div class="row"> <div class="comment col-md-12"> <div class="user-img"><?php echo get_avatar($comment, 65); ?> </div> <h6 class="user-name"><?php comment_author(); ?> </h6> <p class="comment-date"><?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?> </p> <div class="comment-text"><?php comment_text(); ?> </div> </div> </div> </li> <?php }
function fjords_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); ?> <div <?php comment_class(empty($args['has_children']) ? '' : 'parent'); ?> id="comment-<?php comment_ID(); ?> "> <div id="div-comment-<?php comment_ID(); ?> "> <div class="comentarios"> <span class="comment-author vcard"><?php if ($args['avatar_size'] != 0) { echo get_avatar($comment, $args['avatar_size']); } ?> <span class="fn"><a href="<?php comment_author_url(); ?> "> <?php comment_author(); ?> </a></span> wrote @ <span class="comment-meta commentmetadata"><?php comment_date(); ?> at <?php comment_time(); ?> </span> </span> </div> <?php comment_text(); ?> <div class="reply"> <?php comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> </div> <?php }
function humbleshop_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>"> <article class="post pingback"> <p><?php _e( 'Pingback:', 'humbleshop' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'humbleshop' ), ' ' ); ?></p> <?php break; default : ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> <article class="clearfix" <?php //comment_class(); ?> id="comment-<?php comment_ID(); ?>"> <div class="pull-left avatar tcenter"> <?php echo get_avatar( $comment, 40 ); ?> <br> <small class="visible-desktop"><span><?php comment_author(); ?></span> <br> <?php edit_comment_link( __( '<i class="icon-pencil"></i> Edit', 'humbleshop' ), ' ' ); ?></small> </div> <div class="pull-right text"> <?php comment_text(); ?> <?php if ( $comment->comment_approved == '0' ) : ?> <em><?php _e( 'Your comment is awaiting moderation.', 'humbleshop' ); ?></em> <?php endif; ?> <div class="commentmeta clearfix"> <small> <div class="pull-left"> <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"> <time pubdate datetime="<?php comment_time( 'c' ); ?>"><i class="icon-calendar"></i> <?php comment_date(); ?> at <?php comment_time(); ?></time></a> </div> <div class="pull-right"> <i class="icon-ccw"></i> <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> </div></small> </div> </div> <?php break; endswitch; }
function theme_comments_callback($comment, $args, $depth) { ?> <div class="media"> <div class="media-left"> <?php echo get_avatar($comment, $args['avatar_size'], get_template_directory_uri() . '/build/images/avatar-default.png', get_comment_author($comment), array('class' => 'media-object')); ?> </div> <div class="media-body"> <?php if ($comment->comment_approved == '0') { ?> <p class="meta"><em>Uw reactie wacht op goedkeuring</em></p> <?php } else { ?> <time datetime="<?php echo get_comment_date('c'); ?> "><?php echo get_comment_date(__(get_option('date_format'), 'woocommerce')); ?> </time> door <strong><?php comment_author(); ?> </strong> <?php } ?> <div class="comment-text clearfix"> <?php comment_text(); ?> </div> <?php }
<?php if ($comment->comment_approved == '0') { ?> <p class="meta"><em><?php _e('Your comment is awaiting approval', 'woocommerce'); ?> </em></p> <?php } else { ?> <p class="meta"> <strong itemprop="author"><?php comment_author(); ?> </strong> <?php if (get_option('woocommerce_review_rating_verification_label') === 'yes') { if (wc_customer_bought_product($comment->comment_author_email, $comment->user_id, $comment->comment_post_ID)) { echo '<em class="verified">(' . __('verified owner', 'woocommerce') . ')</em> '; } } ?> <time itemprop="datePublished" datetime="<?php echo get_comment_date('c'); ?> "><?php echo get_comment_date(__(get_option('date_format'), 'woocommerce')); ?> </time>
function hrm_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); if ('div' == $args['style']) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> <<?php echo $tag; ?> <?php comment_class(empty($args['has_children']) ? '' : 'parent'); ?> id="comment-<?php comment_ID(); ?> "> <?php if ('div' != $args['style']) { ?> <div id="div-comment-<?php comment_ID(); ?> " class="comment-body"> <?php } ?> <div class="comment-author vcard"> <div> <?php echo get_avatar($comment->comment_author_email, $size = '40'); ?> </div> <div> <h4><?php comment_author(); ?> </h4> <p class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?> "><?php printf('%1$s ' . __('at', 'hrm') . ' %2$s', get_comment_date(), get_comment_time()); ?> </a></p> <?php if ($comment->comment_approved == '0') { ?> <p><em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.', 'hrm'); ?> </em></p> <?php } ?> </div> </div> <div class="row"> <div class="columns small-12"> <hr/> <?php comment_text(); ?> </div> </div> <div class="reply"> <div class="text-right"><?php edit_comment_link("<span class='button info'>" . __('Edit', 'hrm') . "</span>", ' ', ''); ?> <?php comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> </div> <?php if ('div' != $args['style']) { ?> </div> <?php } }
/** * * @global string $comment_status * * @param object $comment */ public function column_author($comment) { global $comment_status; $author_url = get_comment_author_url($comment); $author_url_display = untrailingslashit(preg_replace('|^http(s)?://(www\\.)?|i', '', $author_url)); if (strlen($author_url_display) > 50) { $author_url_display = wp_html_excerpt($author_url_display, 49, '…'); } echo "<strong>"; comment_author($comment); echo '</strong><br />'; if (!empty($author_url_display)) { printf('<a href="%s">%s</a><br />', esc_url($author_url), esc_html($author_url_display)); } if ($this->user_can) { if (!empty($comment->comment_author_email)) { /* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters('comment_email', $comment->comment_author_email, $comment); if (!empty($email) && '@' !== $email) { printf('<a href=\'mailto:%1$s\'>%1$s</a><br />', $email); } } $author_ip = get_comment_author_IP($comment); if ($author_ip) { $author_ip_url = add_query_arg(array('s' => $author_ip, 'mode' => 'detail'), 'edit-comments.php'); if ('spam' == $comment_status) { $author_ip_url = add_query_arg('comment_status', 'spam', $author_ip_url); } printf('<a href="%s">%s</a>', esc_url($author_ip_url), $author_ip); } } }
<p style="font-style:italic;"><?php echo $in_reply_to; ?> :</p> <blockquote style="color:grey;"><?php echo $quoted_text; ?> </blockquote> <?php comment_text($comment->comment_ID); ?> <p style="color:grey;"><?php comment_author($comment->comment_ID); ?> | <a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?> "><?php echo sprintf('%s at %s', get_comment_time(get_option('date_format')), get_comment_time(get_option('time_format'))); ?> </a></p>
function custom_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; global $commentcount; if (!$commentcount) { $commentcount = 0; } ?> <li class="comment <?php if ($comment->comment_author_email == get_the_author_meta('email')) { echo 'admin-comment'; } else { echo 'guest-comment'; } ?> " id="comment-<?php comment_ID(); ?> "> <div class="comment-meta"> <div class="comment-meta-left"> <?php if (function_exists('get_avatar') && get_option('show_avatars')) { echo get_avatar($comment, 35); } ?> <ul class="comment-name-date"> <li class="comment-name"> <?php if (get_comment_author_url()) { ?> <a id="commentauthor-<?php comment_ID(); ?> " class="url <?php if ($comment->comment_author_email == get_the_author_meta('email')) { echo 'admin-url'; } else { echo 'guest-url'; } ?> " href="<?php comment_author_url(); ?> " rel="external nofollow"> <?php } else { ?> <span id="commentauthor-<?php comment_ID(); ?> "> <?php } ?> <?php comment_author(); ?> <?php if (get_comment_author_url()) { ?> </a> <?php } else { ?> </span> <?php } $options = get_option('flat_options'); ?> </li> <li class="comment-date"><?php echo get_comment_time(__('F jS, Y', 'flat')); if ($options['time_stamp']) { echo get_comment_time(__(' g:ia', 'flat')); } ?> </li> </ul> </div> <ul class="comment-act"> <?php if (function_exists('comment_reply_link')) { if (get_option('thread_comments') == '1') { ?> <li class="comment-reply"><?php comment_reply_link(array_merge($args, array('add_below' => 'comment-content', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => '<span><span>' . __('REPLY', 'flat') . '</span></span>'))); ?> </li> <?php } else { ?> <li class="comment-reply"><a href="javascript:void(0);" onclick="MGJS_CMT.reply('commentauthor-<?php comment_ID(); ?> ', 'comment-<?php comment_ID(); ?> ', 'comment');"><?php _e('REPLY', 'flat'); ?> </a></li> <?php } } else { ?> <li class="comment-reply"><a href="javascript:void(0);" onclick="MGJS_CMT.reply('commentauthor-<?php comment_ID(); ?> ', 'comment-<?php comment_ID(); ?> ', 'comment');"><?php _e('REPLY', 'flat'); ?> </a></li> <?php } ?> <li class="comment-quote"><a href="javascript:void(0);" onclick="MGJS_CMT.quote('commentauthor-<?php comment_ID(); ?> ', 'comment-<?php comment_ID(); ?> ', 'comment-content-<?php comment_ID(); ?> ', 'comment');"><?php _e('QUOTE', 'flat'); ?> </a></li> <?php edit_comment_link(__('EDIT', 'flat'), '<li class="comment-edit">', '</li>'); ?> </ul> </div> <div class="comment-content" id="comment-content-<?php comment_ID(); ?> "> <?php if ($comment->comment_approved == '0') { ?> <span class="comment-note"><?php _e('Your comment is awaiting moderation.', 'flat'); ?> </span> <?php } ?> <?php comment_text(); ?> </div> <?php }
function fre_comment_callback($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li class="media et-comment" id="li-comment-<?php comment_ID(); ?> "> <div id="comment-<?php comment_ID(); ?> "> <a class="pull-left avatar-comment" href="#"> <?php echo get_avatar($comment->comment_author_email, 40); ?> </a> <div class="media-body"> <h4 class="media-heading"> <?php comment_author(); ?> </h4> <div class="comment-text"> <?php comment_text(); ?> </div> <span class="time-review"> <i class="fa fa-clock-o"></i> <time> <?php echo ae_the_time(strtotime($comment->comment_date)); ?> </time> </span> <?php comment_reply_link(array_merge($args, array('reply_text' => __(' | Reply ', 'comments') . '<i class="fa fa-edit"></i>', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> </div> <?php }
function get_comment_list_item($id, $alt = 0, $reply = false) { global $authordata, $comment, $wpdb, $user_identity, $user_email, $user_url; get_currentuserinfo(); $id = (int) $id; $comment =& get_comment($id); $class = ''; $post = get_post($comment->comment_post_ID); $authordata = get_userdata($post->post_author); $comment_status = wp_get_comment_status($comment->comment_ID); if (isset($_GET['replyid'])) { $query = remove_query_arg('replyid'); } else { $query = add_query_arg('replyid', $comment->comment_ID); } if ('unapproved' == $comment_status) { $class .= ' unapproved'; } if ($alt % 2) { $class .= ' alternate'; } echo "<li id='comment-{$comment->comment_ID}' class='{$class}'>"; ?> <p><strong><?php comment_author(); ?> </strong> <?php if ($comment->comment_author_email) { ?> | <?php comment_author_email_link(); ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link(); ?> <?php } ?> | <?php _e('IP:'); ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP(); ?> "><?php comment_author_IP(); ?> </a></p> <?php comment_text(); ?> <p><?php comment_date(__('M j, g:i A')); ?> — [ <?php if (current_user_can('edit_post', $comment->comment_post_ID)) { echo " <a href='comment.php?action=editcomment&c=" . $comment->comment_ID . "'>" . __('Edit') . '</a>'; echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; if ('none' != $comment_status && current_user_can('moderate_comments')) { echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; } echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=" . $comment->comment_post_ID . "&c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', {$comment->comment_ID}, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> "; echo " | <a href='" . $query . "' onclick=' return addReplyForm(\"" . get_option('siteurl') . "/wp-content/plugins/soc-comments/soc-comments-post.php\"," . $id . "," . $comment->comment_post_ID . ",\"" . $user_identity . "\",\"" . $user_email . "\",\"" . $user_url . "\",\"" . wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) . "\",\"" . add_query_arg('ajax', '1') . "\")' >" . __('Reply') . " </a>"; } $post = get_post($comment->comment_post_ID); $post_title = wp_specialchars($post->post_title, 'double'); $post_title = '' == $post_title ? "# {$comment->comment_post_ID}" : $post_title; ?> ] — <a href="<?php echo get_permalink($comment->comment_post_ID); ?> "><?php echo $post_title; ?> </a></p> <div id="com-<?php echo $comment->comment_ID; ?> " > <?php if (true == $reply) { ?> <?php if ('open' == $post->comment_status) { ?> <form action="<?php echo get_option('siteurl'); ?> /wp-comments-post.php" method="POST" id="comment-reply-form"> <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p> <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> <input type="hidden" name="comment_post_ID" value="<?php echo $comment->comment_post_ID; ?> " /> <input type="hidden" id="author" name="author" value="<?php echo $user_identity; ?> " /> <input type="hidden" id="email" name="email" value="<?php echo $user_email; ?> " /> <input type="hidden" id="url" name="url" value="<?php echo $user_url; ?> " /> <?php $qs = remove_query_arg('replyid'); ?> <input type="hidden" id="redirect_to"name="redirect_to" value="<?php echo $qs; ?> " /> </p> <?php do_action('comment_form', $comment->comment_post_ID); ?> </form> <?php } else { ?> <p> Sorry. Comments for this post are closed</p> </div> <?php } } ?> </li> <?php }
function dsq_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch ($comment->comment_type) { case '': ?> <li <?php comment_class(); ?> id="dsq-comment-<?php echo comment_ID(); ?> "> <div id="dsq-comment-header-<?php echo comment_ID(); ?> " class="dsq-comment-header"> <cite id="dsq-cite-<?php echo comment_ID(); ?> "> <?php if (comment_author_url()) { ?> <a id="dsq-author-user-<?php echo comment_ID(); ?> " href="<?php echo comment_author_url(); ?> " target="_blank" rel="nofollow"><?php echo comment_author(); ?> </a> <?php } else { ?> <span id="dsq-author-user-<?php echo comment_ID(); ?> "><?php echo comment_author(); ?> </span> <?php } ?> </cite> </div> <div id="dsq-comment-body-<?php echo comment_ID(); ?> " class="dsq-comment-body"> <div id="dsq-comment-message-<?php echo comment_ID(); ?> " class="dsq-comment-message"><?php echo wp_filter_kses(comment_text()); ?> </div> </div> <?php break; case 'pingback': case 'trackback': ?> <li class="post pingback"> <p><?php echo dsq_i('Pingback:'); ?> <?php comment_author_link(); ?> (<?php edit_comment_link(dsq_i('Edit'), ' '); ?> )</p> </li> <?php break; } }
function column_author($comment) { global $comment_status; $author_url = get_comment_author_url(); if ('http://' == $author_url) { $author_url = ''; } $author_url_display = preg_replace('|http://(www\\.)?|i', '', $author_url); if (strlen($author_url_display) > 50) { $author_url_display = substr($author_url_display, 0, 49) . '...'; } echo "<strong>"; comment_author(); echo '</strong><br />'; if (!empty($author_url)) { echo "<a title='{$author_url}' href='{$author_url}'>{$author_url_display}</a><br />"; } if ($this->user_can) { if (!empty($comment->comment_author_email)) { comment_author_email_link(); echo '<br />'; } echo '<a href="edit-comments.php?s='; comment_author_IP(); echo '&mode=detail'; if ('spam' == $comment_status) { echo '&comment_status=spam'; } echo '">'; comment_author_IP(); echo '</a>'; } }
/** * * @global string $comment_status * * @param object $comment */ public function column_author($comment) { global $comment_status; $author_url = get_comment_author_url(); if ('http://' == $author_url) { $author_url = ''; } $author_url_display = preg_replace('|http://(www\\.)?|i', '', $author_url); if (strlen($author_url_display) > 50) { $author_url_display = substr($author_url_display, 0, 49) . '…'; } echo "<strong>"; comment_author(); echo '</strong><br />'; if (!empty($author_url)) { echo "<a title='{$author_url}' href='{$author_url}'>{$author_url_display}</a><br />"; } if ($this->user_can) { if (!empty($comment->comment_author_email)) { comment_author_email_link(); echo '<br />'; } $author_ip = get_comment_author_IP(); if ($author_ip) { $author_ip_url = add_query_arg(array('s' => $author_ip, 'mode' => 'detail'), 'edit-comments.php'); if ('spam' == $comment_status) { $author_ip_url = add_query_arg('comment_status', 'spam', $author_ip_url); } printf('<a href="%s">%s</a>', esc_url($author_ip_url), $author_ip); } } }
function smittenkitchen_custom_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?> "> <article id="div-comment-<?php comment_ID(); ?> " class="comment-body"> <div class="comment-author vcard"> <b class="fn author-name"> <?php if (get_comment_author_url()) { ?> <a href="<?php comment_author_url(); ?> "><?php comment_author(); ?> </a> <?php } else { ?> <?php comment_author(); ?> <?php } ?> </b> </div><!-- .vcard --> <div class="comment-content"> <?php comment_text(); ?> </div> <footer class="comment-footer comment-metadata"> <time <?php comment_time('c'); ?> class="comment-time"> <a href=" <?php comment_link(); ?> "> <span class="date"><?php comment_date(); ?> </span> <?php echo esc_html_x('at', 'smittenkitchen', 'used between date and time'); ?> <span class="time"><?php comment_time(); ?> </span> </a> </time> <span class="edit-link"> <?php edit_comment_link(esc_html__('Edit', 'smittenkitchen')); ?> </span> <span class="reply-link"> <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </span><!-- .reply --> </footer><!-- .comment-footer --> </article><!-- #comment-<?php comment_ID(); ?> --> </li> <?php // End the default styling of comment }
function widget($args, $instance) { // Outputs the content of the widget extract($args); // Make before_widget, etc available. $widget_title = null; $number_of_comments = null; $widget_title = esc_attr(apply_filters('widget_title', $instance['widget_title'])); $number_of_comments = esc_attr($instance['number_of_comments']); echo $before_widget; if (!empty($widget_title)) { echo $before_title . $widget_title . $after_title; } else { echo $before_title . esc_html('Recent Comments', 'popper') . $after_title; } ?> <ul class="popper-widget-list"> <?php if ($number_of_comments == 0) { $number_of_comments = 5; } $args = array('orderby' => 'date', 'number' => $number_of_comments, 'status' => 'approve'); global $comment; // The Query $comments_query = new WP_Comment_Query(); $comments = $comments_query->query($args); // Comment Loop if ($comments) { foreach ($comments as $comment) { ?> <li> <a href="<?php echo get_permalink($comment->comment_post_ID); ?> #comment-<?php echo $comment->comment_ID; ?> "> <div class="post-icon"> <?php echo get_avatar(get_comment_author_email($comment->comment_ID), $size = '96'); ?> </div> <p class="title"><span><?php comment_author(); ?> </span></p> <p class="excerpt"><?php echo esc_attr(comment_excerpt($comment->comment_ID)); ?> </p> <p class="original-title"><span><?php _e('on', 'popper'); ?> </span> <?php the_title_attribute(array('post' => $comment->comment_post_ID)); ?> </p> </a> </li> <?php } } ?> </ul> <?php echo $after_widget; }
init_param('GET', 'deleted', 'integer', 0); init_param('GET', 'approved', 'integer', 0); $criteria = new Criteria('comment_approved', '0 '); // Trick for numeric chars only string compare $commentObjects =& $commentHandler->getObjects($criteria); $comment_rows = array(); foreach ($commentObjects as $commentObject) { $row = $commentObject->getVarArray(); $comment = $commentObject->exportWpObject(); $postObject =& $postHandler->get($commentObject->getVar('comment_post_ID')); if ($postObject) { $row['post_title'] = $postObject->getVar('post_title'); } $row['comment_date'] = mysql2date(get_settings("date_format") . " @ " . get_settings("time_format"), $commentObject->comment_date); $row['post_title'] = $row['post_title'] == '' ? "# {$commentObject->getVar}('comment_post_ID')" : $row['post_title']; $row['comment_author'] = comment_author(false); $row['comment_author_email'] = comment_author_email_link('', '', '', false); $row['comment_author_url'] = comment_author_url_link('', '', '', false); $row['comment_author_IP'] = comment_author_IP(false); $row['comment_content'] = comment_text(false); if (user_can_edit($postObject->getVar('post_author'))) { $comment_rows[] = $row; } } $ticket = $xoopsWPTicket->getTicketHtml(__LINE__); $wpTpl =& new XoopsTpl(); $wpTpl->error_reporting = error_reporting(); $wpTpl->assign('ignored', $ignored); $wpTpl->assign('deleted', $deleted); $wpTpl->assign('approved', $approved); $wpTpl->assign('comments_notify', get_settings('comments_notify'));
function akismet_caught() { global $wpdb, $comment, $akismet_caught, $akismet_nonce; akismet_recheck_queue(); if (isset($_POST['submit']) && 'recover' == $_POST['action'] && !empty($_POST['not_spam'])) { check_admin_referer($akismet_nonce); if (function_exists('current_user_can') && !current_user_can('moderate_comments')) { die(__('You do not have sufficient permission to moderate comments.')); } $i = 0; foreach ($_POST['not_spam'] as $comment) { $comment = (int) $comment; if (function_exists('wp_set_comment_status')) { wp_set_comment_status($comment, 'approve'); } else { $wpdb->query("UPDATE {$wpdb->comments} SET comment_approved = '1' WHERE comment_ID = '{$comment}'"); } akismet_submit_nonspam_comment($comment); ++$i; } $to = add_query_arg('recovered', $i, $_SERVER['HTTP_REFERER']); wp_redirect($to); exit; } if ('delete' == $_POST['action']) { check_admin_referer($akismet_nonce); if (function_exists('current_user_can') && !current_user_can('moderate_comments')) { die(__('You do not have sufficient permission to moderate comments.')); } $delete_time = $wpdb->escape($_POST['display_time']); $nuked = $wpdb->query("DELETE FROM {$wpdb->comments} WHERE comment_approved = 'spam' AND '{$delete_time}' > comment_date_gmt"); wp_cache_delete('akismet_spam_count', 'widget'); $to = add_query_arg('deleted', 'all', $_SERVER['HTTP_REFERER']); wp_redirect($to); exit; } if (isset($_GET['recovered'])) { $i = (int) $_GET['recovered']; echo '<div class="updated"><p>' . sprintf(__('%1$s comments recovered.'), $i) . "</p></div>"; } if (isset($_GET['deleted'])) { echo '<div class="updated"><p>' . __('All spam deleted.') . '</p></div>'; } if (isset($GLOBALS['submenu']['edit-comments.php'])) { $link = 'edit-comments.php'; } else { $link = 'edit.php'; } ?> <style type="text/css"> .akismet-tabs { list-style: none; margin: 0; padding: 0; clear: both; border-bottom: 1px solid #ccc; height: 31px; margin-bottom: 20px; background: #ddd; border-top: 1px solid #bdbdbd; } .akismet-tabs li { float: left; margin: 5px 0 0 20px; } .akismet-tabs a { display: block; padding: 4px .5em 3px; border-bottom: none; color: #036; } .akismet-tabs .active a { background: #fff; border: 1px solid #ccc; border-bottom: none; color: #000; font-weight: bold; padding-bottom: 4px; } #akismetsearch { float: right; margin-top: -.5em; } #akismetsearch p { margin: 0; padding: 0; } </style> <div class="wrap"> <h2><?php _e('Caught Spam'); ?> </h2> <?php $count = get_option('akismet_spam_count'); if ($count) { ?> <p><?php printf(__('Akismet has caught <strong>%1$s spam</strong> for you since you first installed it.'), number_format_i18n($count)); ?> </p> <?php } $spam_count = akismet_spam_count(); if (0 == $spam_count) { echo '<p>' . __('You have no spam currently in the queue. Must be your lucky day. :)') . '</p>'; echo '</div>'; } else { echo '<p>' . __('You can delete all of the spam from your database with a single click. This operation cannot be undone, so you may wish to check to ensure that no legitimate comments got through first. Spam is automatically deleted after 15 days, so don’t sweat it.') . '</p>'; if (!isset($_POST['s'])) { ?> <form method="post" action="<?php echo attribute_escape(add_query_arg('noheader', 'true')); ?> "> <?php akismet_nonce_field($akismet_nonce); ?> <input type="hidden" name="action" value="delete" /> <?php printf(__('There are currently %1$s comments identified as spam.'), $spam_count); ?> <input type="submit" class="button delete" name="Submit" value="<?php _e('Delete all'); ?> " /> <input type="hidden" name="display_time" value="<?php echo current_time('mysql', 1); ?> " /> </form> <?php } ?> </div> <div class="wrap"> <?php if (isset($_POST['s'])) { ?> <h2><?php _e('Search'); ?> </h2> <?php } else { echo '<p>' . __('These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.') . '</p>'; } if (isset($_POST['s'])) { $s = $wpdb->escape($_POST['s']); $comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE\n\t\t(comment_author LIKE '%{$s}%' OR\n\t\tcomment_author_email LIKE '%{$s}%' OR\n\t\tcomment_author_url LIKE ('%{$s}%') OR\n\t\tcomment_author_IP LIKE ('%{$s}%') OR\n\t\tcomment_content LIKE ('%{$s}%') ) AND\n\t\tcomment_approved = 'spam'\n\t\tORDER BY comment_date DESC"); } else { if (isset($_GET['apage'])) { $page = (int) $_GET['apage']; } else { $page = 1; } if ($page < 2) { $page = 1; } $current_type = false; if (isset($_GET['ctype'])) { $current_type = preg_replace('|[^a-z]|', '', $_GET['ctype']); } $comments = akismet_spam_comments($current_type, $page); $total = akismet_spam_count($current_type); $totals = akismet_spam_totals(); ?> <ul class="akismet-tabs"> <li <?php if (!isset($_GET['ctype'])) { echo ' class="active"'; } ?> ><a href="edit-comments.php?page=akismet-admin"><?php _e('All'); ?> </a></li> <?php foreach ($totals as $type => $type_count) { if ('comment' == $type) { $type = 'comments'; $show = __('Comments'); } else { $show = ucwords($type); } $type_count = number_format_i18n($type_count); $extra = $current_type === $type ? ' class="active"' : ''; echo "<li {$extra}><a href='edit-comments.php?page=akismet-admin&ctype={$type}'>{$show} ({$type_count})</a></li>"; } do_action('akismet_tabs'); // so plugins can add more tabs easily ?> </ul> <?php } if ($comments) { ?> <form method="post" action="<?php echo attribute_escape("{$link}?page=akismet-admin"); ?> " id="akismetsearch"> <p> <input type="text" name="s" value="<?php if (isset($_POST['s'])) { echo attribute_escape($_POST['s']); } ?> " size="17" /> <input type="submit" class="button" name="submit" value="<?php echo attribute_escape(__('Search Spam »')); ?> " /> </p> </form> <?php if ($total > 50) { $total_pages = ceil($total / 50); $r = ''; if (1 < $page) { $args['apage'] = 1 == $page - 1 ? '' : $page - 1; $r .= '<a class="prev" href="' . clean_url(add_query_arg($args)) . '">' . __('« Previous Page') . '</a>' . "\n"; } if (($total_pages = ceil($total / 50)) > 1) { for ($page_num = 1; $page_num <= $total_pages; $page_num++) { if ($page == $page_num) { $r .= "<strong>{$page_num}</strong>\n"; } else { $p = false; if ($page_num < 3 || $page_num >= $page - 3 && $page_num <= $page + 3 || $page_num > $total_pages - 3) { $args['apage'] = 1 == $page_num ? '' : $page_num; $r .= '<a class="page-numbers" href="' . clean_url(add_query_arg($args)) . '">' . $page_num . "</a>\n"; $in = true; } elseif ($in == true) { $r .= "...\n"; $in = false; } } } } if ($page * 50 < $total || -1 == $total) { $args['apage'] = $page + 1; $r .= '<a class="next" href="' . clean_url(add_query_arg($args)) . '">' . __('Next Page »') . '</a>' . "\n"; } echo "<p>{$r}</p>"; ?> <?php } ?> <form style="clear: both;" method="post" action="<?php echo attribute_escape(add_query_arg('noheader', 'true')); ?> "> <?php akismet_nonce_field($akismet_nonce); ?> <input type="hidden" name="action" value="recover" /> <ul id="spam-list" class="commentlist" style="list-style: none; margin: 0; padding: 0;"> <?php $i = 0; foreach ($comments as $comment) { $i++; $comment_date = mysql2date(get_option("date_format") . " @ " . get_option("time_format"), $comment->comment_date); $post = get_post($comment->comment_post_ID); $post_title = $post->post_title; if ($i % 2) { $class = 'class="alternate"'; } else { $class = ''; } echo "\n\t<li id='comment-{$comment->comment_ID}' {$class}>"; ?> <p><strong><?php comment_author(); ?> </strong> <?php if ($comment->comment_author_email) { ?> | <?php comment_author_email_link(); ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link(); ?> <?php } ?> | <?php _e('IP:'); ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP(); ?> "><?php comment_author_IP(); ?> </a></p> <?php comment_text(); ?> <p><label for="spam-<?php echo $comment->comment_ID; ?> "> <input type="checkbox" id="spam-<?php echo $comment->comment_ID; ?> " name="not_spam[]" value="<?php echo $comment->comment_ID; ?> " /> <?php _e('Not Spam'); ?> </label> — <?php comment_date('M j, g:i A'); ?> — [ <?php $post = get_post($comment->comment_post_ID); $post_title = wp_specialchars($post->post_title, 'double'); $post_title = '' == $post_title ? "# {$comment->comment_post_ID}" : $post_title; ?> <a href="<?php echo get_permalink($comment->comment_post_ID); ?> " title="<?php echo $post_title; ?> "><?php _e('View Post'); ?> </a> ] </p> <?php } ?> </ul> <?php if ($total > 50) { $total_pages = ceil($total / 50); $r = ''; if (1 < $page) { $args['apage'] = 1 == $page - 1 ? '' : $page - 1; $r .= '<a class="prev" href="' . clean_url(add_query_arg($args)) . '">' . __('« Previous Page') . '</a>' . "\n"; } if (($total_pages = ceil($total / 50)) > 1) { for ($page_num = 1; $page_num <= $total_pages; $page_num++) { if ($page == $page_num) { $r .= "<strong>{$page_num}</strong>\n"; } else { $p = false; if ($page_num < 3 || $page_num >= $page - 3 && $page_num <= $page + 3 || $page_num > $total_pages - 3) { $args['apage'] = 1 == $page_num ? '' : $page_num; $r .= '<a class="page-numbers" href="' . clean_url(add_query_arg($args)) . '">' . $page_num . "</a>\n"; $in = true; } elseif ($in == true) { $r .= "...\n"; $in = false; } } } } if ($page * 50 < $total || -1 == $total) { $args['apage'] = $page + 1; $r .= '<a class="next" href="' . clean_url(add_query_arg($args)) . '">' . __('Next Page »') . '</a>' . "\n"; } echo "<p>{$r}</p>"; } ?> <p class="submit"> <input type="submit" name="submit" value="<?php echo attribute_escape(__('De-spam marked comments »')); ?> " /> </p> <p><?php _e('Comments you de-spam will be submitted to Akismet as mistakes so it can learn and get better.'); ?> </p> </form> <?php } else { ?> <p><?php _e('No results found.'); ?> </p> <?php } ?> <?php if (!isset($_POST['s'])) { ?> <form method="post" action="<?php echo attribute_escape(add_query_arg('noheader', 'true')); ?> "> <?php akismet_nonce_field($akismet_nonce); ?> <p><input type="hidden" name="action" value="delete" /> <?php printf(__('There are currently %1$s comments identified as spam.'), $spam_count); ?> <input type="submit" name="Submit" class="button" value="<?php echo attribute_escape(__('Delete all')); ?> " /> <input type="hidden" name="display_time" value="<?php echo current_time('mysql', 1); ?> " /></p> </form> <?php } ?> </div> <?php } }
function my_theme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch ($comment->comment_type) { default: ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?> "> <p class="meta-comment"> <?php echo get_avatar($comment, 30); ?> <span class="author-name"><?php comment_author(); ?> </span> <time <?php comment_time('c'); ?> class="comment-time"> <span class="date"> <?php comment_date(); ?> </span> <span class="time"> <?php comment_time(); ?> </span> </time> </p> <div class="comment-content"> <?php comment_text(); ?> </div> <div class="comment-actions"> <div class="reply"><?php comment_reply_link(array_merge($args, array('reply_text' => 'Reply', 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div><!-- .reply --> </div> <!-- #comment-<?php comment_ID(); ?> --> <?php // End the default styling of comment break; } }