protected function comment($comment, $depth, $args)
 {
     // each comment markup, without </li>!
     $classes = implode(' ', get_comment_class()) . ($comment->comment_author_email == get_the_author_meta('email') ? ' author-comment' : '');
     // get typical wp comment classes and if comment belong post autor add "author-comment" class
     echo '<li id="li-comment-' . get_comment_ID() . '" class="' . $classes . '">' . "\n";
     // parent tag with classes and uniq id
     echo '<div id="comment-' . get_comment_ID() . '">' . "\n";
     // anchor element with this id need to anchor links on comments works
     echo get_avatar($comment, 64) . "\n";
     // show avatar with size 64x64 px
     echo '<p class="meta">Posted by: ' . get_comment_author() . "\n";
     // comment autor name
     echo ' ' . get_comment_author_email();
     // comment autor email
     echo ' ' . get_comment_author_url();
     // comment autor url
     echo ' On ' . get_comment_date('F j, Y') . ' at ' . get_comment_time() . '</p>' . "\n";
     // date and time of comment creating
     if ('0' == $comment->comment_approved) {
         echo '<em class="comment-awaiting-moderation">Your comment is awaiting moderation</em>' . "\n";
     }
     // if comment is not approved notify of it
     comment_text() . "\n";
     // display comment text
     $reply_link_args = array('depth' => $depth, 'reply_text' => 'Reply on it', 'login_text' => 'You must be logged to post comments');
     echo get_comment_reply_link(array_merge($args, $reply_link_args));
     // display reply link
     echo '</div>' . "\n";
     // anchor element end
 }
 function framework_comment_avatar($avatar = true, $gravatar_size = 50)
 {
     $author = get_comment_author();
     $url = get_comment_author_url();
     if (!empty($url) || 'http://' == !$url) {
         $uri = ' href="' . $url . '" ';
     } else {
         $uri = NULL;
     }
     if ($avatar) {
         // Get author's gavatar
         $gravatar_email = get_comment_author_email();
         $gravatar_size = apply_filters('framework_gravatar_size', (int) $gravatar_size);
         // Available filter: framework_gravatar_size
         $gravatar = get_avatar($gravatar_email, $gravatar_size);
         // get the $src data from $gavatar
         if (preg_match('/src=\'(.*?)\'/i', $gravatar, $matches)) {
             $src = $matches[1];
         }
         // Rebuild Gravatar link because get_avatar() produces invalid code :/ (P.S. adds "gravatar" class)
         $output = "<a class=\"avatar-link\"{$uri}><img class=\"avatar gravatar gravatar-{$gravatar_size}\" alt=\"{$author}'s Gravatar\" src=\"{$src}\" width=\"{$gravatar_size}\" height=\"{$gravatar_size}\" /></a>";
         return apply_filters('framework_comment_avatar', (string) $output);
         // Available filter: framework_comment_avatar
     }
 }
Exemple #3
0
 protected function comment($comment, $depth, $args)
 {
     // разметка каждого комментария, без закрывающего </li>!
     $classes = implode(' ', get_comment_class()) . ($comment->comment_author_email == get_the_author_meta('email') ? ' author-comment' : '');
     // берем стандартные классы комментария и если коммент пренадлежит автору поста добавляем класс author-comment
     echo '<li id="li-comment-' . get_comment_ID() . '" class="' . $classes . '">' . "\n";
     // родительский тэг комментария с классами выше и уникальным id
     echo '<div id="comment-' . get_comment_ID() . '">' . "\n";
     // элемент с таким id нужен для якорных ссылок на коммент
     echo get_avatar($comment, 64) . "\n";
     // покажем аватар с размером 64х64
     echo '<p class="meta">Автор: ' . get_comment_author() . "\n";
     // имя автора коммента
     echo ' ' . get_comment_author_email();
     // email автора коммента
     echo ' ' . get_comment_author_url();
     // url автора коммента
     echo ' Добавлено ' . get_the_time('l, F jS, Y') . ' в ' . get_the_time() . '</p>' . "\n";
     // дата и время комментирования
     if ('0' == $comment->comment_approved) {
         echo '<em class="comment-awaiting-moderation">Ваш комментарий будет опубликован после проверки модератором.</em>' . "\n";
     }
     // если комментарий должен пройти проверку
     comment_text() . "\n";
     // текст коммента
     $reply_link_args = array('depth' => $depth, 'reply_text' => 'Ответить', 'login_text' => 'Вы должны быть залогинены');
     echo get_comment_reply_link(array_merge($args, $reply_link_args));
     // выводим ссылку ответить
     echo '</div>' . "\n";
     // закрываем див
 }
/**
* Better display of avatars in comments
* Should only be used in comment sections (may update in future)
* Checks for false empty commenter URLs 'http://' w/registered users
* Adds the class 'photo' to the image
* Adds a call to 'images/trackback.jpg' for trackbacks
* Adds a call to 'images/pingback.jpg' for pingbacks
*
* Filters should only return a string for an image URL for the avatar with class $avatar
* They should not get the avatar as this is done after the filter
*
* @since 0.2
* @filter
*/
function comicpress_avatar()
{
    global $comment;
    $url = get_comment_author_url();
    $comment_type = get_comment_type();
    if (get_settings('avatar_default')) {
        $avatar = get_settings('avatar_default');
    }
    //	$avatar = apply_filters('comicpress_avatar', $avatar);
    if ($comment_type != 'pingback' && $comment_type != 'trackback') {
        echo '<div class="comment-avatar">';
        if ($url == true && $url != 'http://') {
            echo '<a href="' . $url . '" rel="external nofollow" title="' . wp_specialchars(get_comment_author(), 1) . '">';
        }
        $id_or_email = get_comment_author_email();
        if (empty($id_or_email)) {
            $id_or_email = get_comment_author();
        }
        if (function_exists('comicpress_get_avatar') && $comment_type != 'pingback' && $comment_type != 'trackback') {
            echo str_replace("alt='", "alt='" . wp_specialchars(get_comment_author(), 1) . "' title='" . wp_specialchars(get_comment_author(), 1), comicpress_get_avatar($id_or_email, 64));
        } else {
            echo '<img src="' . get_template_directory_uri() . '/' . $avatar . '" class="avatar photo" />';
        }
        if ($url == true && $url != 'http://') {
            echo '</a>';
        }
        echo '</div>';
    }
}
Exemple #5
0
function efreetant_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
  <div id="comment-<?php 
    comment_ID();
    ?>
" <?php 
    comment_class('comment');
    ?>
>
    <article  class="comment">
      <header class="comment-author">
        <?php 
    $bgauthemail = get_comment_author_email();
    ?>
        <img data-gravatar="http://www.gravatar.com/avatar/<?php 
    echo md5($bgauthemail);
    ?>
?s=40" class="avatar" height="40" width="40" src="<?php 
    echo get_template_directory_uri();
    ?>
/images/nothing.gif" />
        <?php 
    printf(__('<cite class="fn">%1$s</cite> %2$s', 'efreetanttheme'), get_comment_author_link(), edit_comment_link(__('(Edit)', 'efreetanttheme'), '  ', ''));
    ?>
        <time datetime="<?php 
    echo comment_time('Y-m-j');
    ?>
"><a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    comment_time(__('F jS, Y', 'efreetanttheme'));
    ?>
 </a></time>
     </header>
      <?php 
    if ($comment->comment_approved == '0') {
        ?>
        <div class="alert alert-info">
          <p><?php 
        _e('Your comment is awaiting moderation.', 'efreetanttheme');
        ?>
</p>
        </div>
      <?php 
    }
    ?>
      <section class="comment_content">
        <?php 
    comment_text();
    ?>
      </section>
      <?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
    </article>
<?php 
}
Exemple #6
0
function joints_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
	<li <?php 
    comment_class('panel');
    ?>
>
		<article id="comment-<?php 
    comment_ID();
    ?>
" class="clearfix large-12 columns">
			<header class="comment-author">
				<?php 
    // create variable
    $bgauthemail = get_comment_author_email();
    ?>
				<?php 
    printf(__('<cite class="fn">%s</cite>', 'jointstheme'), get_comment_author_link());
    ?>
 on
				<time datetime="<?php 
    echo comment_time('Y-m-j');
    ?>
"><a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    comment_time(__(' F jS, Y - g:ia', 'jointstheme'));
    ?>
 </a></time>
				<?php 
    edit_comment_link(__('(Edit)', 'jointstheme'), '  ', '');
    ?>
			</header>
			<?php 
    if ($comment->comment_approved == '0') {
        ?>
				<div class="alert alert-info">
					<p><?php 
        _e('Your comment is awaiting moderation.', 'jointstheme');
        ?>
</p>
				</div>
			<?php 
    }
    ?>
			<section class="comment_content clearfix">
				<?php 
    comment_text();
    ?>
			</section>
			<?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
		</article>
	<!-- </li> is added by WordPress automatically -->
<?php 
}
Exemple #7
0
function custom_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
	<li <?php 
    comment_class();
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
" >
		<div class="c-grav"><?php 
    echo get_avatar(get_comment_author_email(), '40');
    ?>
</div>
		<div class="c-body">
			<div class="c-head">
				<?php 
    comment_author_link();
    ?>
 <span class="c-permalink"><a href="<?php 
    echo get_permalink();
    ?>
#comment-<?php 
    comment_ID();
    ?>
"><?php 
    _e('permalink', 'titan');
    ?>
</a></span>
			</div>
			<?php 
    if ($comment->comment_approved == '0') {
        ?>
				<p><?php 
        _e('<em><strong>Please Note:</strong> Your comment is awaiting moderation.</em>', 'titan');
        ?>
</p>
			<?php 
    }
    ?>
			<?php 
    comment_text();
    ?>
			<?php 
    comment_type('', 'Trackback', 'Pingback');
    ?>
			<div class="reply">
				<?php 
    echo comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth']));
    ?>
			</div>
			<?php 
    edit_comment_link(__('Edit', 'titan'));
    ?>
		</div><!--end c-body-->
<?php 
}
    function ct_apex_customize_comments($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        global $post;
        ?>
		<li <?php 
        comment_class();
        ?>
 id="li-comment-<?php 
        comment_ID();
        ?>
">
			<article id="comment-<?php 
        comment_ID();
        ?>
" class="comment">
				<div class="comment-author">
					<?php 
        echo get_avatar(get_comment_author_email(), 48, '', get_comment_author());
        ?>
					<span class="author-name"><?php 
        comment_author_link();
        ?>
</span>
				</div>
				<div class="comment-content">
					<?php 
        if ($comment->comment_approved == '0') {
            ?>
						<em><?php 
            _e('Your comment is awaiting moderation.', 'apex');
            ?>
</em>
						<br/>
					<?php 
        }
        ?>
					<?php 
        comment_text();
        ?>
				</div>
				<div class="comment-footer">
					<span class="comment-date"><?php 
        comment_date();
        ?>
</span>
					<?php 
        comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'apex'), 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        ?>
					<?php 
        edit_comment_link(__('Edit', 'apex'));
        ?>
				</div>
			</article>
	<?php 
    }
Exemple #9
0
/**
 * Displays the author karma.
 */
function hmn_cp_the_comment_author_karma()
{
    if (class_exists('CommentPopularity\\HMN_Comment_Popularity')) {
        $hmn_cp_obj = CommentPopularity\HMN_Comment_Popularity::get_instance();
        $author_karma = $hmn_cp_obj->get_comment_author_karma(get_comment_author_email(get_comment_ID()));
        if (isset($author_karma)) {
            echo '<small class="user-karma">(User Karma: ' . esc_html($author_karma) . ')</small>';
        }
    }
}
Exemple #10
0
function comment_add_microid($classes)
{
    $c_email = get_comment_author_email();
    $c_url = get_comment_author_url();
    if (!empty($c_email) && !empty($c_url)) {
        $microid = 'microid-mailto+http:sha1:' . sha1(sha1('mailto:' . $c_email) . sha1($c_url));
        $classes[] = $microid;
    }
    return $classes;
}
Exemple #11
0
function wpbx_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    $commenter = get_comment_author_link();
    if (ereg('<a[^>]* class=[^>]+>', $commenter)) {
        $commenter = ereg_replace('(<a[^>]* class=[\'"]?)', '\\1url ', $commenter);
    } else {
        $commenter = ereg_replace('(<a )/', '\\1class="url "', $commenter);
    }
    $avatar_email = get_comment_author_email();
    $avatarURL = get_bloginfo('template_directory');
    $avatar = str_replace("class='avatar", "class='avatar", get_avatar($avatar_email, 40, $default = $avatarURL . '/images/gravatar-blank.jpg'));
    ?>
	<li <?php 
    comment_class();
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
		<div id="div-comment-<?php 
    comment_ID();
    ?>
">
			<div class="comment-author vcard">
				<?php 
    echo $avatar . ' <span class="fn n">' . $commenter . '</span>';
    ?>
			</div>
			<div class="comment-meta">
				<?php 
    printf(__('%1$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'wpbx'), get_comment_date('j M Y', '', '', false), get_comment_time(), '#comment-' . get_comment_ID());
    edit_comment_link(__('Edit', 'wpbx'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>');
    ?>
				<span class="reply-link">
					<span class="meta-sep">|</span> <?php 
    comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
				</span>
			</div>

			<?php 
    if ($comment->comment_approved == '0') {
        _e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'wpbx');
    }
    ?>

			<div class="comment-content"><?php 
    comment_text();
    ?>
</div>
		</div>
<?php 
}
 function widget($args, $instance)
 {
     global $comments, $comment, $woocommerce;
     $cache = wp_cache_get('widget_recent_reviews', 'widget');
     if (!is_array($cache)) {
         $cache = array();
     }
     if (isset($cache[$args['widget_id']])) {
         echo $cache[$args['widget_id']];
         return;
     }
     ob_start();
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Reviews', 'woocommerce') : $instance['title'], $instance, $this->id_base);
     if (!($number = absint($instance['number']))) {
         $number = 5;
     }
     $comments = get_comments(array('number' => $number, 'status' => 'approve', 'post_status' => 'publish', 'post_type' => 'product'));
     if ($comments) {
         echo $before_widget;
         if ($title) {
             echo $before_title . $title . $after_title;
         }
         echo '<ul class="ratings-small">';
         foreach ((array) $comments as $comment) {
             $_product = get_product($comment->comment_post_ID);
             $rating = intval(get_comment_meta($comment->comment_ID, 'rating', true));
             $rating_html = $_product->get_rating_html($rating);
             echo '<li>';
             echo '<div class="image">
                     <a href="' . esc_url(get_comment_link($comment->comment_ID)) . '" title="' . esc_attr($_product->get_title()) . '">
                         <img src="http://www.gravatar.com/avatar/' . md5(get_comment_author_email()) . '?s=60&d=retro&r=g" alt="" />
                     </a>
                 </div>';
             echo '<div class="desc">
                         <h6>' . get_comment_author() . '</h6><small>' . get_comment_date() . '</small>';
             echo '<div class="rating rating-' . (int) $_product->get_average_rating() . '">';
             for ($i = 1; $i <= (int) $_product->get_average_rating(); $i++) {
                 echo '<i class="icon-heart"></i>' . "\n";
             }
             echo '</div>';
             echo '</div>
                 </li>';
         }
         echo '</ul>';
         echo $after_widget;
     }
     $content = ob_get_clean();
     if (isset($args['widget_id'])) {
         $cache[$args['widget_id']] = $content;
     }
     echo $content;
     wp_cache_set('widget_recent_reviews', $cache, 'widget');
 }
Exemple #13
0
function commenter_link()
{
    $commenter = get_comment_author_link();
    if (ereg('<a[^>]* class=[^>]+>', $commenter)) {
        $commenter = ereg_replace('(<a[^>]* class=[\'"]?)', '\\1url ', $commenter);
    } else {
        $commenter = ereg_replace('(<a )/', '\\1class="url "', $commenter);
    }
    $avatar_email = get_comment_author_email();
    $avatar = str_replace("class='avatar", "class='photo avatar", get_avatar($avatar_email, 80));
    echo $avatar . ' <span class="fn n">' . $commenter . '</span>';
}
function commenter_link()
{
    $commenter = get_comment_author_link();
    if (ereg('<a[^>]* class=[^>]+>', $commenter)) {
        $commenter = ereg_replace('(<a[^>]* class=[\'"]?)', '\\1url ', $commenter);
    } else {
        $commenter = ereg_replace('(<a )/', '\\1class="url "', $commenter);
    }
    $avatar_email = get_comment_author_email();
    $avatar = str_replace("class='avatar", "class='photo avatar", get_avatar($avatar_email, 80));
    echo ' <a href="' . get_comment_author_url() . '" title="Comment Author" target="_blank">' . $avatar . '</a>';
}
Exemple #15
0
function wpi_post_author_selector_filter($selector = false)
{
    global $authordata, $comment;
    $output = get_comment_type();
    if ($output == 'comment') {
        $post_author_email = strtolower($authordata->user_email);
        $commenter_email = strtolower(get_comment_author_email());
        $output = $post_author_email == $commenter_email && $authordata->ID == $comment->user_id ? 'post-author' : 'commenter';
        //$output = ' '.$authordata->ID.' == '.$comment->user_id ;
    }
    return $selector . ' ' . $output;
}
Exemple #16
0
 function evolve_comment_avatar()
 {
     global $default;
     $gravatar_email = get_comment_author_email();
     $author = get_comment_author();
     $output = get_avatar($gravatar_email, 45, $default, $author);
     if (get_option('show_avatars')) {
         // Avatars enabled?
         return apply_filters('evolve_comment_avatar', (string) $output);
         // Available filter: evolve_comment_avatar
     }
 }
    function wpbpcomments($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        ?>

        <li id="comment-<?php 
        comment_ID();
        ?>
" <?php 
        comment_class();
        ?>
>
            <article>
                <div>
                    <?php 
        echo get_avatar(get_comment_author_email(get_comment_ID()), $size = '100');
        ?>
                </div>
                <div>
                    <?php 
        printf(__('<h5 class="comment-author post-title">%1$s</h5>', 'wpbp'), get_comment_author_link());
        ?>
                    <time datetime="<?php 
        echo comment_time('Y-m-j');
        ?>
" class="block-image text-push">
                            <?php 
        comment_time(__('F jS, Y', 'wpbp'));
        ?>
                    </time>
                    <?php 
        comment_text();
        ?>
                </div>
                <?php 
        if ($comment->comment_approved == '0') {
            ?>
                    <p class="awaiting-approval xxs-text vm0"><?php 
            _e('Your comment is awaiting moderation.', 'wpbp');
            ?>
</p>
                <?php 
        }
        ?>

                <?php 
        comment_reply_link(array_merge(array('reply_text' => __('Reply to ', 'wpbp') . get_comment_author()), array('depth' => $depth, 'max_depth' => $args['max_depth'])));
        ?>
            </article>
        <?php 
    }
function thematic_commenter_link()
{
    $commenter = get_comment_author_link();
    if (ereg('<a[^>]* class=[^>]+>', $commenter)) {
        $commenter = ereg_replace('(<a[^>]* class=[\'"]?)', '\\1url ', $commenter);
    } else {
        $commenter = ereg_replace('(<a )/', '\\1class="url "', $commenter);
    }
    $avatar_email = get_comment_author_email();
    $avatar_size = apply_filters('avatar_size', '80');
    // Available filter: avatar_size
    $avatar = str_replace("class='avatar", "class='photo avatar", get_avatar($avatar_email, $avatar_size));
    echo $avatar . ' <span class="fn n">' . $commenter . '</span>';
}
	function widget( $args, $instance ) {

        global $comments, $comment;

		$cache = wp_cache_get('widget_erc', 'widget');

		if ( ! is_array( $cache ) )
			$cache = array();

		if ( isset( $cache[$args['widget_id']] ) ) {
			echo $cache[$args['widget_id']];
			return;
		}

 		extract($args, EXTR_SKIP);
 		$output = '';
 		$title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments', 'ultimatum') : $instance['title']);

		if ( ! $number = (int) $instance['number'] )
 			$number = 5;
 		else if ( $number < 1 )
 			$number = 1;

		$size = $instance['size'];

		$comments = get_comments( array( 'number' => $number, 'status' => 'approve' ) );
		$output .= $before_widget;
		if ( $title )
			$output .= $before_title . $title . $after_title;

		$output .= '<ul class="recent-comments">';
		if ( $comments ) {
			foreach ( (array) $comments as $comment) {
				$output .=  '<li class="recent-comment">';
				$output .=  get_avatar(get_comment_author_email($comment->comment_ID), $size) . ' ';
				$output .=  /* translators: extended comments widget: 1: comment author, 2: post link */ sprintf(__('%1$s on %2$s', 'ultimatum'), get_comment_author_link(), '<a href="' . esc_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>');
				$comment = get_comment($comment->comment_ID,ARRAY_A);
				$output .= '<br />'.substr($comment["comment_content"],0,$instance['length']).'...';
				$output .=  '</li>';
			}
 		}
		$output .= '</ul>';
		$output .= $after_widget;
		$output = str_replace('avatar avatar', 'avatar alignleft avatar', $output);
		echo $output;
		$cache[$args['widget_id']] = $output;
		wp_cache_set('widget_erc', $cache, 'widget');
	}
Exemple #20
0
/**
 * Linked avatar images for Tarski.
 * 
 * Links to the comment author's home page if they have one, and just returns
 * the image otherwise.
 * 
 * @since 2.3
 * 
 * @return string
 */
function tarski_avatar()
{
    $default = '';
    if ('' == get_option('avatar_default')) {
        $default = get_bloginfo('template_directory') . '/images/avatar.png';
    }
    $avatar = get_avatar(get_comment_author_email(), '50', $default);
    if (!$avatar) {
        return false;
    }
    $url = get_comment_author_url();
    if (empty($url) || preg_match('/^\\s*http:\\/\\/\\s*$/', $url)) {
        return $avatar;
    } else {
        return "<a class=\"avatar-link\" href=\"{$url}\" rel=\"external nofollow\">{$avatar}</a>";
    }
}
 function widget($args, $instance)
 {
     extract($args);
     global $wpdb;
     $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,comment_author_url,comment_author_email, SUBSTRING(comment_content,1,42) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 5";
     $comments = $wpdb->get_results($sql);
     $output = $pre_HTML;
     foreach ($comments as $comment) {
         $output .= "<li><div class='img'>" . get_avatar(get_comment_author_email(), 50) . "</div><div class=\"author\"><a href=\"" . get_comment_link($comment->comment_ID) . "\" title=\"" . $comment->post_title . "\"><strong>" . strip_tags($comment->comment_author) . "</strong> : " . stripslashes(convert_smilies($comment->com_excerpt)) . "...</a></div></li>";
     }
     $output .= $post_HTML;
     echo $before_widget;
     if ($instance['title']) {
         echo $before_title . $instance['title'] . $after_title;
     }
     echo '<ul class="spy">';
     echo $output;
     echo '</ul>';
     echo $after_widget;
 }
Exemple #22
0
/**
* Better display of avatars in comments
* Should only be used in comment sections (may update in future)
* Checks for false empty commenter URLs 'http://' w/registered users
* Adds the class 'photo' to the image
* Adds a call to 'images/trackback.jpg' for trackbacks
* Adds a call to 'images/pingback.jpg' for pingbacks
*
* Filters should only return a string for an image URL for the avatar with class $avatar
* They should not get the avatar as this is done after the filter
*
* @since 0.2
* @filter
*/
function comicpress_avatar()
{
    global $comment;
    $url = get_comment_author_url();
    $comment_type = get_comment_type();
    if ($comment_type != 'pingback' && $comment_type != 'trackback') {
        echo '<div class="comment-avatar">';
        if ($url == true && $url != 'http://') {
            echo '<a href="' . $url . '" rel="external nofollow" title="' . esc_html(get_comment_author(), 1) . '">';
        }
        $id_or_email = get_comment_author_email();
        if (empty($id_or_email)) {
            $id_or_email = get_comment_author();
        }
        $return_str = str_replace('photo', 'photo instant nocorner itxtalt', get_avatar($id_or_email, 64, comicpress_random_default_avatar($id_or_email), esc_html(get_comment_author(), 1)));
        echo $return_str;
        if ($url == true && $url != 'http://') {
            echo '</a>';
        }
        echo '</div>';
    }
}
Exemple #23
0
 function evolve_comment_avatar($avatar = true, $gravatar_size = 60)
 {
     $author = get_comment_author();
     if ($avatar) {
         // Get author's gavatar
         $gravatar_email = get_comment_author_email();
         $gravatar_size = apply_filters('evolve_gravatar_size', (int) $gravatar_size);
         // Available filter: evolve_gravatar_size
         $gravatar = get_avatar($gravatar_email, $gravatar_size);
         // get the $src data from $gavatar
         if (preg_match('/src=\'(.*?)\'/i', $gravatar, $matches)) {
             $src = $matches[1];
         }
         // Rebuild Gravatar link because get_avatar() produces invalid code :/ (P.S. adds "gravatar" class)
         $output = "<img class=\"avatar gravatar gravatar-{$gravatar_size}\" alt=\"{$author}'s Gravatar\" src=\"{$src}\" width=\"{$gravatar_size}\" height=\"{$gravatar_size}\" />";
         if (get_option('show_avatars')) {
             // Avatars enabled?
             return apply_filters('evolve_comment_avatar', (string) $output);
             // Available filter: evolve_comment_avatar
         }
     }
 }
Exemple #24
0
function mytheme_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
   <li <?php 
    comment_class();
    ?>
 id="li-comment-<?php 
    comment_ID();
    ?>
">
     <div id="comment-<?php 
    comment_ID();
    ?>
">
		<?php 
    echo get_avatar(get_comment_author_email(), 46) . '<br />';
    comment_time('F j, g:i a');
    comment_text();
    ?>
     </div>
   </li>
<?php 
}
Exemple #25
0
function gsalborz_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
  <div id="comment-<?php 
    comment_ID();
    ?>
" <?php 
    comment_class('cf');
    ?>
>
    <article  class="cf">
      <header class="comment-author vcard">
        <?php 
    /*
      this is the new responsive optimized comment image. It used the new HTML5 data-attribute to display comment gravatars on larger screens only. What this means is that on larger posts, mobile sites don't have a ton of requests for comment images. This makes load time incredibly fast! If you'd like to change it back, just replace it with the regular wordpress gravatar call:
      echo get_avatar($comment,$size='32',$default='<path_to_url>' );
    */
    ?>
        <?php 
    // custom gravatar call
    ?>
        <?php 
    // create variable
    $bgauthemail = get_comment_author_email();
    ?>
        <img data-gravatar="http://www.gravatar.com/avatar/<?php 
    echo md5($bgauthemail);
    ?>
?s=40" class="load-gravatar avatar avatar-48 photo" height="40" width="40" src="<?php 
    echo get_template_directory_uri();
    ?>
/library/images/nothing.gif" />
        <?php 
    // end custom gravatar call
    ?>
        <?php 
    printf(__('<cite class="fn">%1$s</cite> %2$s', 'gsalborz'), get_comment_author_link(), edit_comment_link(__('(Edit)', 'gsalborz'), '  ', ''));
    ?>
        <time datetime="<?php 
    echo comment_time('Y-m-j');
    ?>
"><a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    comment_time(__('F jS, Y', 'gsalborz'));
    ?>
 </a></time>

      </header>
      <?php 
    if ($comment->comment_approved == '0') {
        ?>
        <div class="alert alert-info">
          <p><?php 
        _e('Your comment is awaiting moderation.', 'gsalborz');
        ?>
</p>
        </div>
      <?php 
    }
    ?>
      <section class="comment_content cf">
        <?php 
    comment_text();
    ?>
      </section>
      <?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
    </article>
  <?php 
    // </li> is added by WordPress automatically
}
Exemple #26
0
/**
* Sets a class for each comment
* Sets alt, odd/even, and author/user classes
* Adds author, user, and reader classes
*
* @since 0.2
*/
function hybrid_comment_class()
{
    global $comment;
    static $comment_alt;
    $classes = array();
    if (function_exists('get_comment_class')) {
        $classes = get_comment_class();
    }
    $classes[] = get_comment_type();
    /*
     * User classes
     */
    if ($comment->user_id > 0 && ($user = get_userdata($comment->user_id))) {
        $classes[] = 'user user-' . $user->user_nicename;
        if ($post = get_post($post_id)) {
            if ($comment->user_id === $post->post_author) {
                $classes[] = 'author author-' . $user->user_nicename;
            }
        }
    } else {
        $classes[] = 'reader';
    }
    /*
     * Alt classes
     */
    if ($comment_alt++ % 2) {
        $classes[] = 'even';
        $classes[] = 'alt';
    } else {
        $classes[] = 'odd';
    }
    /*
     * http://microid.org
     */
    $email = get_comment_author_email();
    $url = get_comment_author_url();
    if (!empty($email) && !empty($url)) {
        $microid = 'microid-mailto+http:sha1:' . sha1(sha1('mailto:' . $email) . sha1($url));
        $classes[] = $microid;
    }
    $classes = join(' ', $classes);
    echo $classes;
}
Exemple #27
0
    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;
    }
Exemple #28
0
function wpgrade_comments($comment, $args, $depth)
{
    static $comment_number;
    if (!isset($comment_number)) {
        $comment_number = $args['per_page'] * ($args['page'] - 1) + 1;
    } else {
        $comment_number++;
    }
    $GLOBALS['comment'] = $comment;
    ?>
<li <?php 
    comment_class();
    ?>
>
	<article id="comment-<?php 
    echo $comment->comment_ID;
    ?>
" class="comment-article  media">
		<?php 
    if (wpgrade::option('comments_show_numbering')) {
        ?>
			<span class="comment-number"><?php 
        echo $comment_number;
        ?>
</span>
		<?php 
    }
    ?>
		<?php 
    if (wpgrade::option('comments_show_avatar') && get_comment_type($comment->comment_ID) == 'comment') {
        ?>
			<aside class="comment__avatar  media__img">
				<!-- custom gravatar call -->
				<?php 
        $bgauthemail = get_comment_author_email();
        ?>
				<img src="http://www.gravatar.com/avatar/<?php 
        echo md5($bgauthemail);
        ?>
?s=60" class="comment__avatar-image" height="60" width="60" style="background-image: <?php 
        echo get_template_directory_uri() . '/library/images/nothing.gif';
        ?>
; background-size: 100% 100%"/>
			</aside>
		<?php 
    }
    ?>
		<div class="media__body">
			<header class="comment__meta comment-author">
				<?php 
    printf('<span class="comment__author-name">%s</span>', get_comment_author_link());
    ?>
				<time class="comment__time" datetime="<?php 
    comment_time('c');
    ?>
">
					<a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
" class="comment__timestamp"><?php 
    printf(__('on %s at %s', 'rosa_txtd'), get_comment_date(), get_comment_time());
    ?>
 </a>
				</time>
				<div class="comment__links">
					<?php 
    edit_comment_link(__('Edit', 'rosa_txtd'), '  ', '');
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
				</div>
			</header>
			<!-- .comment-meta -->
			<?php 
    if ($comment->comment_approved == '0') {
        ?>
				<div class="alert info">
					<p><?php 
        _e('Your comment is awaiting moderation.', 'rosa_txtd');
        ?>
</p>
				</div>
			<?php 
    }
    ?>
			<section class="comment__content comment">
				<?php 
    comment_text();
    ?>
			</section>
		</div>
	</article>
	<!-- </li> is added by WordPress automatically -->
<?php 
}
/**
 * Display the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commentors' email address. Most assume that
 * their email address will not appear in raw form on the blog. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 *
 * @param int $comment_ID Optional. The ID of the comment for which to print the author's email. Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $author_email = get_comment_author_email($comment_ID);
    /**
     * Filter the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_ID` parameter was added.
     *
     * @param string $author_email The comment author's email address.
     * @param int $comment_ID The comment ID.
     */
    echo apply_filters('author_email', $author_email, $comment_ID);
}
Exemple #30
0
function ahimsa_custom_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>

    <!-- WP automatically closes this tag below in wp_list_comments -->
    <li>

    <fieldset <?php 
    comment_class(empty($args['has_children']) ? '' : 'parent');
    ?>
        id="comment-<?php 
    comment_ID();
    ?>
">

        <legend class='title'>
            <?php 
    printf(__('%s writes:', "ahimsa"), comment_author_link());
    ?>
        </legend>

        <div class="capsule dateauthor">
            <small>
            <a href='<?php 
    print esc_url(get_comment_link($comment->comment_ID));
    ?>
'>
            <?php 
    /* translators: this is the comment date/time format. See http://php.net/date */
    $comment_date_format = __('F jS, Y', 'ahimsa');
    /* translators: this is the comment date bubble */
    printf(__('%1$s at %2$s', 'ahimsa'), get_comment_date($comment_date_format), get_comment_time());
    ?>
            </a>
            </small>
        </div>

        <?php 
    if (function_exists('get_avatar')) {
        echo get_avatar(get_comment_author_email(), '50');
    }
    ?>

        <div class='commenttext'>

            <?php 
    if ($comment->comment_approved == '0') {
        ?>
                <span class='capsule'>
                    <?php 
        _e("Your comment is awaiting moderation.", "ahimsa");
        ?>
                </span>
                <br />
            <?php 
    }
    ?>

            <?php 
    comment_text();
    ?>

        </div>

        <div class='postmetadata replybuttonbox'>

            <?php 
    global $user_ID;
    if ($user_ID) {
        edit_comment_link(__('Edit', "ahimsa"), "<div class='capsule actbubble commentactions'>", "</div>");
    }
    comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'ahimsa'), 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '<div class="capsule actbubble commentactions">', 'after' => '</div>')));
    ?>

            <div style='height: 1px; clear: both;'></div>

        </div>

    </fieldset>

<?php 
}