当前位置: 首页>>代码示例>>PHP>>正文


PHP get_comment_author_email函数代码示例

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


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


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