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


PHP get_comment_author_url函数代码示例

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


在下文中一共展示了get_comment_author_url函数的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 ' <br>Добавлено ' . get_comment_date('F j, Y') . ' в ' . get_comment_time() . "\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:Ivan26ru,项目名称:gp-wp,代码行数:30,代码来源:functions.php

示例2: 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

示例3: mysiteapp_get_member_for_comment

function mysiteapp_get_member_for_comment()
{
    $need_g_avatar = true;
    $user = array();
    $user['author'] = get_comment_author();
    $user['link'] = get_comment_author_url();
    $options = get_option('uppsite_options');
    if (isset($options['disqus'])) {
        $user['avatar'] = mysiteapp_get_pic_from_fb_profile($user['link']);
        if ($user['avatar']) {
            $need_g_avatar = false;
        }
    }
    if ($need_g_avatar) {
        if (function_exists('get_avatar') && function_exists('htmlspecialchars_decode')) {
            $user['avatar'] = htmlspecialchars_decode(uppsite_extract_src_url(get_avatar(get_comment_author_email())));
        }
    }
    ?>
<member>
    <name><![CDATA[<?php 
    echo $user['author'];
    ?>
]]></name>
    <member_link><![CDATA[<?php 
    echo $user['link'];
    ?>
]]></member_link>
    <avatar><![CDATA[<?php 
    echo $user['avatar'];
    ?>
]]></avatar>
</member><?php 
}
开发者ID:alpual,项目名称:Caitlin-Sabo,代码行数:34,代码来源:functions.php

示例4: 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

示例5: comment_author_profile_link

/**
 * Set the content width based on the theme's design and stylesheet.
 *
 * Used to set the width of images and content. Should be equal to the width the theme
 * is designed for, generally via the style.css stylesheet.
 */
function comment_author_profile_link()
{
    /* Get the comment author information */
    global $comment;
    $comment_ID = $comment->user_id;
    $author = get_comment_author($comment_ID);
    $url = get_comment_author_url($comment_ID);
    /* Check if commenter is registered or not */
    /* Registered Commenter */
    $registeredID = get_userdata($comment_ID);
    $authorName = $registeredID->display_name;
    $authorLevel = $registeredID->user_level;
    $authorURL = $registeredID->user_url;
    $authorID = $registeredID->ID;
    /* Check if they have edit posts capabilities & is author or higher */
    if ($authorLevel > 1 && user_can($authorID, 'edit_posts') == true && count_user_posts($authorID) > 0) {
        /* Author+ with Posts */
        $return = '<a href="' . home_url() . '/?author=' . $authorID . '">' . $authorName . '</a>';
    } else {
        /* Below Author */
        if (empty($authorURL) || 'http://' == $authorURL) {
            $return = $authorName;
        } else {
            $return = "<a href='{$authorURL}' rel='external nofollow' class='url' target='_blank'>{$authorName}</a>";
        }
    }
    return $return;
}
开发者ID:swena,项目名称:Online-Magazine-Website,代码行数:34,代码来源:functions.php

示例6: tokopress_comments

function tokopress_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
    <li itemprop="reviews" itemscope="" itemtype="http://schema.org/Review" class="comment even thread-even depth-1" id="li-comment-105">
        <div id="comment-105" class="comment_container">
            <?php 
    echo get_avatar($comment, $size = '60');
    ?>
            <div class="comment-text">
                <div class="entry-meta">
                    <span class="author vcard"><a class="url fn n" rel="author" href="<?php 
    echo get_comment_author_url();
    ?>
" title="<?php 
    echo get_comment_author();
    ?>
 <?php 
    _e('Says', 'tokopress');
    ?>
"><?php 
    echo get_comment_author();
    ?>
</a></span>
                    <time class="published" datetime="<?php 
    echo get_comment_date('c');
    ?>
" title="<?php 
    echo get_comment_date('l, F jS, Y, g:i a');
    ?>
"><?php 
    echo get_comment_date();
    ?>
</time> <?php 
    comment_reply_link(array_merge($args, array('reply_text' => __('. Reply', 'tokopress'), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
                </div>
                <div itemprop="description" class="description">
                    <?php 
    if ($comment->comment_approved == '0') {
        ?>
                        <div class="alert alert-moderation">
                            <p><em><?php 
        _e('Your comment is awaiting moderation.', 'tokopress');
        ?>
</em></p>
                        </div>
                    <?php 
    }
    ?>
                    <?php 
    comment_text();
    ?>
                </div>
            </div>
        </div>
    </li><!-- #comment-## -->
    <?php 
}
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:59,代码来源:comments.php

示例7: dsq_render_single_comment

    function dsq_render_single_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        ?>
		<li id="dsq-comment-<?php 
        echo (int) get_comment_ID();
        ?>
">
			<div id="dsq-comment-header-<?php 
        echo (int) get_comment_ID();
        ?>
" class="dsq-comment-header">
				<cite id="dsq-cite-<?php 
        echo (int) get_comment_ID();
        ?>
">
					<?php 
        if (comment_author_url()) {
            ?>
						<a id="dsq-author-user-<?php 
            echo (int) get_comment_ID();
            ?>
" href="<?php 
            echo esc_url(get_comment_author_url());
            ?>
" target="_blank" rel="nofollow"><?php 
            echo esc_html(get_comment_author());
            ?>
</a>
					<?php 
        } else {
            ?>
						<span id="dsq-author-user-<?php 
            echo (int) get_comment_ID();
            ?>
"><?php 
            echo esc_html(get_comment_author());
            ?>
</span>
					<?php 
        }
        ?>
				</cite>
			</div>
			<div id="dsq-comment-body-<?php 
        echo (int) get_comment_ID();
        ?>
" class="dsq-comment-body">
				<div id="dsq-comment-message-<?php 
        echo (int) get_comment_ID();
        ?>
" class="dsq-comment-message"><?php 
        wp_filter_kses(comment_text());
        ?>
</div>
			</div>
		</li>
		<?php 
    }
开发者ID:humanmade,项目名称:vip-mu-plugins-public,代码行数:59,代码来源:comments.php

示例8: 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

示例9: wpi_get_comment_author

function wpi_get_comment_author()
{
    if (get_comment_type() != 'comment') {
        $author = get_host(get_comment_author_url());
        $author = str_rem("www.", $author);
    } else {
        $author = get_comment_author();
    }
    return $author;
}
开发者ID:Creativebq,项目名称:wp-istalker,代码行数:10,代码来源:comments.php

示例10: getCommentAuthorURL

 public static function getCommentAuthorURL($commentID)
 {
     if (class_exists(InnThemeComment::class) && method_exists(InnThemeComment::class, 'getCommentAuthorURL')) {
         return InnThemeComment::getCommentAuthorURL($commentID);
     }
     static $cache = [];
     if (!isset($cache[$commentID])) {
         $cache[$commentID] = \get_comment_author_url($commentID);
     }
     return $cache[$commentID];
 }
开发者ID:kmvan,项目名称:poiauthor,代码行数:11,代码来源:Api.php

示例11: get_comment_author_url_link

function get_comment_author_url_link( $linktext = '', $before = '', $after = '' ) {
	global $comment;
	$url = get_comment_author_url();
	$display = ($linktext != '') ? $linktext : $url;
	$display = str_replace( 'http://www.', '', $display );
	$display = str_replace( 'http://', '', $display );
	if ( '/' == substr($display, -1) )
		$display = substr($display, 0, -1);
	$return = "$before<a href='$url' rel='external'>$display</a>$after";
	return apply_filters('get_comment_author_url_link', $return);
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:11,代码来源:comment-template.php

示例12: column_author

    /**
     * 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) . '&hellip;';
        }
        // 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
    }
开发者ID:kgneil,项目名称:bsocial-comments,代码行数:57,代码来源:class-bsocial-comments-feedback-table.php

示例13: get_comment_author_url_link

function get_comment_author_url_link($linktext = '', $before = '', $after = '')
{
    global $comment;
    $url = get_comment_author_url();
    $display = $linktext != '' ? $linktext : $url;
    $display = str_replace('http://www.', '', $display);
    $display = str_replace('http://', '', $display);
    if ('/' == substr($display, -1)) {
        $display = substr($display, 0, -1);
    }
    $return = "{$before}<a href='{$url}' rel='external'>{$display}</a>{$after}";
    return apply_filters('get_comment_author_url_link', $return);
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:13,代码来源:comment-template.php

示例14: author_link

function author_link()
{
    global $comment;
    $comment_ID = $comment->user_id;
    $author = get_comment_author($comment_ID);
    $url = get_comment_author_url($comment_ID);
    if (empty($url) || 'http://' == $url) {
        $return = $author;
    } else {
        $return = "{$author}";
    }
    return $return;
}
开发者ID:swebdevteam,项目名称:wordpress-starter-theme,代码行数:13,代码来源:cleanup.php

示例15: cjh_get_comment_author_link

/** 获取评论者的链接 */
function cjh_get_comment_author_link()
{
    global $comment_ID;
    $url = get_comment_author_url($comment_ID);
    $author = get_comment_author($comment_ID);
    if (empty($url) || 'http://' == $url) {
        if ($author == "陈建杭") {
            return $author . '<span class="host-tag">博主</span>';
        } else {
            return $author;
        }
    } else {
        return "<a rel='external nofollow' href='{$url}' target='_blank'>{$author}</a>";
    }
}
开发者ID:cjhgithub,项目名称:ctheme,代码行数:16,代码来源:comment.php


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