• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_comment_author_email函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_comment_author_email函数的典型用法代码示例。如果您正苦于以下问题:PHP get_comment_author_email函数的具体用法?PHP get_comment_author_email怎么用?PHP get_comment_author_email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_comment_author_email函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: comment

 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";
     // закрываем див
 }
开发者ID:dsrproject,项目名称:perfuniq,代码行数:31,代码来源:functions.php


示例2: framework_comment_avatar

 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
     }
 }
开发者ID:sandesh247,项目名称:sandesh247.com,代码行数:25,代码来源:pluggable.php


示例3: comment

 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
 }
开发者ID:seredniy,项目名称:clean-wp-template,代码行数:31,代码来源:functions.php


示例4: comicpress_avatar

/**
* 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>';
    }
}
开发者ID:johnbintz,项目名称:comicpress-2.8,代码行数:43,代码来源:comment-functions.php


示例5: efreetant_comments

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 
}
开发者ID:efreetant,项目名称:stellar,代码行数:60,代码来源:functions.php


示例6: joints_comments

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 
}
开发者ID:nusserstudios,项目名称:JointsWP,代码行数:59,代码来源:comments.php


示例7: custom_comment

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 
}
开发者ID:JustDevZero,项目名称:Wordpress,代码行数:58,代码来源:comments.php


示例8: ct_apex_customize_comments

    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 
    }
开发者ID:jackpower,项目名称:objectivemoney-angular,代码行数:56,代码来源:functions.php


示例9: hmn_cp_the_comment_author_karma

/**
 * 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>';
        }
    }
}
开发者ID:zakaria340,项目名称:critique,代码行数:13,代码来源:helpers.php


示例10: comment_add_microid

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;
}
开发者ID:cabelotaina,项目名称:redelivre,代码行数:10,代码来源:comments.php


示例11: wpbx_comment

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 
}
开发者ID:hqro,项目名称:Rush_WP,代码行数:54,代码来源:functions.php


示例12: widget

 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');
 }
开发者ID:ravenvn,项目名称:sandau,代码行数:54,代码来源:widget-recent-reviews.php


示例13: commenter_link

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>';
}
开发者ID:hasanhalabi,项目名称:jDMS,代码行数:12,代码来源:settings.php


示例14: commenter_link

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>';
}
开发者ID:nicoladj77,项目名称:code-veronica,代码行数:12,代码来源:misc-functions.php


示例15: wpi_post_author_selector_filter

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;
}
开发者ID:Creativebq,项目名称:wp-istalker,代码行数:12,代码来源:comments.php


示例16: evolve_comment_avatar

 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
     }
 }
开发者ID:berniecultess,项目名称:infirev,代码行数:12,代码来源:pluggable.php


示例17: wpbpcomments

    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 
    }
开发者ID:tgallimore,项目名称:wp-boilerplate,代码行数:51,代码来源:theme-setup.php


示例18: thematic_commenter_link

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>';
}
开发者ID:blazingcloud,项目名称:blog.blazingcloud.net,代码行数:14,代码来源:comments-extensions.php


示例19: widget

	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');
	}
开发者ID:polaris610,项目名称:medicalhound,代码行数:48,代码来源:the-comments.php


示例20: tarski_avatar

/**
 * 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>";
    }
}
开发者ID:nihad,项目名称:tarski,代码行数:27,代码来源:comments_helper.php



注:本文中的get_comment_author_email函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_comment_author_email_link函数代码示例发布时间:2022-05-15
下一篇:
PHP get_comment_author_IP函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap