Пример #1
6
 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
 }
Пример #2
4
    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 
    }
Пример #3
1
 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";
     // закрываем див
 }
Пример #4
0
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 
}
Пример #5
0
 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
     }
 }
Пример #6
0
/**
 * 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;
}
Пример #7
0
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 
}
Пример #8
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;
}
Пример #9
0
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;
}
Пример #10
0
 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];
 }
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);
}
    /**
     * 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
    }
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);
}
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;
}
Пример #15
0
/** 获取评论者的链接 */
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>";
    }
}
Пример #16
0
/**
* Bootstrap comment template
*/
function comments_feed_template_callback($comment, $args, $depth)
{
    $GLOBAL['comment'] = $comment;
    ?>

    <div class="media">
      <a href="<?php 
    echo get_comment_author_url();
    ?>
" class="pull-left">
        <?php 
    echo get_avatar($comment);
    ?>
      </a>

      <div class="media-body">
        <h5 class="media-heading">
          <a href="<?php 
    echo get_comment_author_url();
    ?>
">
            <?php 
    echo get_comment_author();
    ?>
          </a>
          <small>
            <?php 
    comment_date();
    ?>
 at <?php 
    comment_time();
    ?>
          </small>
        </h5>

        <?php 
    comment_text();
    ?>

        <?php 
    comment_reply_link(array_merge($args, array('reply_text' => __('<strong>reply</strong> <i class="icon-share-alt"></i>'), 'depth' => $depth, 'max-depth' => $args['max_depth'])));
    ?>
      </div>
    </div>

  <?php 
}
Пример #17
0
function us_comment_start($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    $author_link_start = $author_link_end = '';
    $author_url = get_comment_author_url();
    if ($author_url != '') {
        $author_link_start = '<a href="' . $author_url . '" target="_blank">';
        $author_link_end = '</a>';
    }
    ?>

	<div class="w-comments-item" id="comment-<?php 
    comment_ID();
    ?>
">
		<div class="w-comments-item-meta">
			<div class="w-comments-item-icon">
				<?php 
    echo get_avatar($comment, $size = '50');
    ?>
			</div>
			<div class="w-comments-item-author"><?php 
    echo $author_link_start . get_comment_author() . $author_link_end;
    ?>
</div>
			<a class="w-comments-item-date" href="#comment-<?php 
    comment_ID();
    ?>
"><?php 
    echo get_comment_date() . ' ' . get_comment_time();
    ?>
</a>
		</div>
		<div class="w-comments-item-text"><?php 
    comment_text();
    ?>
</div>
		<?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '<span class="w-comments-item-answer">', 'after' => '</span>')));
    ?>
	</div>


<?php 
}
Пример #18
0
/**
* Properly displays comment author name/link
* bbPress and other external systems sometimes don't set a display name for registrations
* WP has problems if no display name is set
* WP gives registered users URL of 'http://' if none is set
*
* @since 0.2.2
*/
function comicpress_comment_author()
{
    global $comment;
    $author = get_comment_author();
    $url = get_comment_author_url();
    /*
     * Registered members w/o URL defaults to 'http://'
     */
    if ($url == 'http://') {
        $url = false;
    }
    /*
     * Registered through bbPress sometimes leaves no display name
     * Bug with bbPress 0.9 series and WP 2.5 (no later testing)
     * 'Anonymous' should be localized according to WP, not the theme
     */
    if ($comment->user_id > 0) {
        $user = get_userdata($comment->user_id);
        if ($user->display_name) {
            $author = $user->display_name;
        } elseif ($user->user_nickname) {
            $author = $user->nickname;
        } elseif ($user->user_nicename) {
            $author = $user->user_nicename;
        } else {
            $author = $user->user_login;
        }
    }
    /*
     * Display link and cite if URL is set
     * Also properly cites trackbacks/pingbacks
     */
    if ($url) {
        $output = '<cite title="' . $url . '">';
        $output .= '<a href="' . $url . '" title="' . wp_specialchars($author, 1) . '" class="external nofollow">' . $author . '</a>';
        $output .= '</cite>';
    } else {
        $output = '<cite>';
        $output .= $author;
        $output .= '</cite>';
    }
    echo $output;
}
Пример #19
0
/**
 * HTML for outputting blog comments as defined by the WP comment API
 *
 * @param mixed $comment Comment record from database
 * @param array $args Arguments from wp_list_comments() call
 * @param int $depth Comment nesting level
 * @see wp_list_comments()
 * @package BuddyPress Theme
 * @since 1.2
 */
function bp_dtheme_blog_comments( $comment, $args, $depth ) {
	$GLOBALS['comment'] = $comment; ?>

	<?php if ( 'pingback' == $comment->comment_type ) return false; ?>

	<li id="comment-<?php comment_ID(); ?>">
		<div class="comment-avatar-box">
			<div class="avb">
				<a href="<?php echo get_comment_author_url() ?>" rel="nofollow">
					<?php if ( $comment->user_id ) : ?>
						<?php echo bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'width' => 50, 'height' => 50, 'email' => $comment->comment_author_email ) ); ?>
					<?php else : ?>
						<?php echo get_avatar( $comment, 50 ) ?>
					<?php endif; ?>
				</a>
			</div>
		</div>

		<div class="comment-content">

			<div class="comment-meta">
				<a href="<?php echo get_comment_author_url() ?>" rel="nofollow"><?php echo get_comment_author(); ?></a> <?php _e( 'said:', 'buddypress' ) ?>
				<em><?php _e( 'On', 'buddypress' ) ?> <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date() ?></a></em>
			</div>

			<?php if ( $comment->comment_approved == '0' ) : ?>
			 	<em class="moderate"><?php _e('Your comment is awaiting moderation.'); ?></em><br />
			<?php endif; ?>

			<?php comment_text() ?>

			<div class="comment-options">
				<?php echo comment_reply_link( array('depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ?>
				<?php edit_comment_link( __( 'Edit' ),'','' ); ?>
			</div>

		</div>
<?php
}
Пример #20
0
/**
* Properly displays comment author name/link
* bbPress and other external systems sometimes don't set a display name for registrations
* WP has problems if no display name is set
* WP gives registered users URL of 'http://' if none is set
*
* @since 0.2.2
*/
function hybrid_comment_author()
{
    global $comment;
    $author = get_comment_author();
    $url = get_comment_author_url();
    /*
     * Registered members w/o URL defaults to 'http://'
     */
    if ($url == 'http://') {
        $url = false;
    }
    /*
     * Registered through bbPress sometimes leaves no display name
     * Bug with bbPress 0.9 series and WP 2.5 (no later testing)
     */
    if (!$author && $comment->user_id > 0) {
        $user = get_userdata($comment->user_id);
        if ($user->display_name !== '') {
            $author = $user->display_name;
        } elseif ($user->user_nickname !== '') {
            $author = $user->nickname;
        } elseif ($user->user_nicename !== '') {
            $author = $user->user_nicename;
        } else {
            $author = $user->user_login;
        }
    }
    /*
     * Display link and cite if URL is set
     * Also properly cites trackbacks/pingbacks
     */
    if ($url) {
        $output = '<cite title="' . $url . '">';
        $output .= '<a href="' . $url . '" title="' . $author . '" class="external nofollow">' . $author . '</a>';
        $output .= '</cite>';
    } else {
        $output = '<cite>';
        $output .= $author;
        $output .= '</cite>';
    }
    echo $output;
}
Пример #21
0
/**
 * Displays the avatar for the comment author and wraps it in the comment author's URL if it is
 * available.  Adds a call to HYBRID_IMAGES . "/{$comment_type}.png" for the default avatars for
 * trackbacks and pingbacks.
 *
 * @since 0.2.0
 * @access public
 * @global $comment The current comment's DB object.
 * @global $hybrid The global Hybrid object.
 * @return void
 */
function hybrid_avatar()
{
    global $comment, $hybrid;
    /* Make sure avatars are allowed before proceeding. */
    if (!get_option('show_avatars')) {
        return false;
    }
    /* Get/set some comment variables. */
    $comment_type = get_comment_type($comment->comment_ID);
    $author = get_comment_author($comment->comment_ID);
    $url = get_comment_author_url($comment->comment_ID);
    $avatar = '';
    $default_avatar = '';
    /* Get comment types that are allowed to have an avatar. */
    $avatar_comment_types = apply_filters('get_avatar_comment_types', array('comment'));
    /* If comment type is in the allowed list, check if it's a pingback or trackback. */
    if (in_array($comment_type, $avatar_comment_types)) {
        /* Set a default avatar for pingbacks and trackbacks. */
        $default_avatar = 'pingback' == $comment_type || 'trackback' == $comment_type ? trailingslashit(HYBRID_IMAGES) . "{$comment_type}.png" : '';
        /* Allow the default avatar to be filtered by comment type. */
        $default_avatar = apply_filters("{$hybrid->prefix}_{$comment_type}_avatar", $default_avatar);
    }
    /* Set up the avatar size. */
    $comment_list_args = hybrid_list_comments_args();
    $size = $comment_list_args['avatar_size'] ? $comment_list_args['avatar_size'] : 80;
    /* Get the avatar provided by the get_avatar() function. */
    $avatar = get_avatar($comment, absint($size), $default_avatar, $author);
    /* If URL input, wrap avatar in hyperlink. */
    if (!empty($url) && !empty($avatar)) {
        $avatar = '<a href="' . esc_url($url) . '" rel="external nofollow" title="' . esc_attr($author) . '">' . $avatar . '</a>';
    }
    /* Display the avatar and allow it to be filtered. Note: Use the get_avatar filter hook where possible. */
    echo apply_filters("{$hybrid->prefix}_avatar", $avatar);
}
 /**
  *
  * @global string $comment_status
  *
  * @param object $comment
  */
 public function column_author($comment)
 {
     global $comment_status;
     $author_url = get_comment_author_url($comment);
     $author_url_display = untrailingslashit(preg_replace('|^http(s)?://(www\\.)?|i', '', $author_url));
     if (strlen($author_url_display) > 50) {
         $author_url_display = wp_html_excerpt($author_url_display, 49, '&hellip;');
     }
     echo "<strong>";
     comment_author($comment);
     echo '</strong><br />';
     if (!empty($author_url_display)) {
         printf('<a href="%s">%s</a><br />', esc_url($author_url), esc_html($author_url_display));
     }
     if ($this->user_can) {
         if (!empty($comment->comment_author_email)) {
             /* This filter is documented in wp-includes/comment-template.php */
             $email = apply_filters('comment_email', $comment->comment_author_email, $comment);
             if (!empty($email) && '@' !== $email) {
                 printf('<a href=\'mailto:%1$s\'>%1$s</a><br />', $email);
             }
         }
         $author_ip = get_comment_author_IP($comment);
         if ($author_ip) {
             $author_ip_url = add_query_arg(array('s' => $author_ip, 'mode' => 'detail'), 'edit-comments.php');
             if ('spam' == $comment_status) {
                 $author_ip_url = add_query_arg('comment_status', 'spam', $author_ip_url);
             }
             printf('<a href="%s">%s</a>', esc_url($author_ip_url), $author_ip);
         }
     }
 }
function custom_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    global $commentcount;
    if (!$commentcount) {
        $commentcount = 0;
    }
    ?>

 <li class="comment <?php 
    if ($comment->comment_author_email == get_the_author_meta('email')) {
        echo 'admin-comment';
    } else {
        echo 'guest-comment';
    }
    ?>
" id="comment-<?php 
    comment_ID();
    ?>
">
  <div class="comment-meta">
   <div class="comment-meta-left">
  <?php 
    if (function_exists('get_avatar') && get_option('show_avatars')) {
        echo get_avatar($comment, 35);
    }
    ?>
  
    <ul class="comment-name-date">
     <li class="comment-name">
<?php 
    if (get_comment_author_url()) {
        ?>
<a id="commentauthor-<?php 
        comment_ID();
        ?>
" class="url <?php 
        if ($comment->comment_author_email == get_the_author_meta('email')) {
            echo 'admin-url';
        } else {
            echo 'guest-url';
        }
        ?>
" href="<?php 
        comment_author_url();
        ?>
" rel="external nofollow">
<?php 
    } else {
        ?>
<span id="commentauthor-<?php 
        comment_ID();
        ?>
">
<?php 
    }
    ?>

<?php 
    comment_author();
    ?>

<?php 
    if (get_comment_author_url()) {
        ?>
</a>
<?php 
    } else {
        ?>
</span>
<?php 
    }
    $options = get_option('flat_options');
    ?>
     </li>
     <li class="comment-date"><?php 
    echo get_comment_time(__('F jS, Y', 'flat'));
    if ($options['time_stamp']) {
        echo get_comment_time(__(' g:ia', 'flat'));
    }
    ?>
</li>
    </ul>
   </div>

   <ul class="comment-act">
<?php 
    if (function_exists('comment_reply_link')) {
        if (get_option('thread_comments') == '1') {
            ?>
    <li class="comment-reply"><?php 
            comment_reply_link(array_merge($args, array('add_below' => 'comment-content', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => '<span><span>' . __('REPLY', 'flat') . '</span></span>')));
            ?>
</li>
<?php 
        } else {
            ?>
    <li class="comment-reply"><a href="javascript:void(0);" onclick="MGJS_CMT.reply('commentauthor-<?php 
            comment_ID();
            ?>
', 'comment-<?php 
            comment_ID();
            ?>
', 'comment');"><?php 
            _e('REPLY', 'flat');
            ?>
</a></li>
<?php 
        }
    } else {
        ?>
    <li class="comment-reply"><a href="javascript:void(0);" onclick="MGJS_CMT.reply('commentauthor-<?php 
        comment_ID();
        ?>
', 'comment-<?php 
        comment_ID();
        ?>
', 'comment');"><?php 
        _e('REPLY', 'flat');
        ?>
</a></li>
<?php 
    }
    ?>
    <li class="comment-quote"><a href="javascript:void(0);" onclick="MGJS_CMT.quote('commentauthor-<?php 
    comment_ID();
    ?>
', 'comment-<?php 
    comment_ID();
    ?>
', 'comment-content-<?php 
    comment_ID();
    ?>
', 'comment');"><?php 
    _e('QUOTE', 'flat');
    ?>
</a></li>
    <?php 
    edit_comment_link(__('EDIT', 'flat'), '<li class="comment-edit">', '</li>');
    ?>
   </ul>

  </div>
  <div class="comment-content" id="comment-content-<?php 
    comment_ID();
    ?>
">
  <?php 
    if ($comment->comment_approved == '0') {
        ?>
   <span class="comment-note"><?php 
        _e('Your comment is awaiting moderation.', 'flat');
        ?>
</span>
  <?php 
    }
    ?>
  <?php 
    comment_text();
    ?>
  </div>

<?php 
}
Пример #24
0
    function wpmudev_blog_comments($comment, $args, $depth)
    {
        global $themename, $shortname, $options, $options2, $options3, $bp_existed, $multi_site_on;
        if ($bp_existed == 'true') {
            $GLOBALS['comment'] = $comment;
            if ('pingback' == $comment->comment_type) {
                return false;
            }
            if (1 == $depth) {
                $avatar_size = 50;
            } else {
                $avatar_size = 25;
            }
            ?>

	<li <?php 
            comment_class();
            ?>
 id="li-comment-<?php 
            comment_ID();
            ?>
">
		<div id="comment-<?php 
            comment_ID();
            ?>
">
		<div class="comment-author vcard">
				<a href="<?php 
            echo get_comment_author_url();
            ?>
" rel="nofollow">
					<?php 
            if ($comment->user_id) {
                ?>
						<?php 
                echo bp_core_fetch_avatar(array('item_id' => $comment->user_id, 'width' => $avatar_size, 'height' => $avatar_size, 'email' => $comment->comment_author_email));
                ?>
					<?php 
            } else {
                ?>
						<?php 
                echo get_avatar($comment, $avatar_size);
                ?>
					<?php 
            }
            ?>
				</div>
					<?php 
            if ($comment->comment_approved == '0') {
                ?>
						<em><?php 
                _e('Your comment is awaiting moderation.', 'framemarket');
                ?>
</em>
						<br />
					<?php 
            }
            ?>

					<div class="comment-meta commentmetadata"><a href="<?php 
            echo esc_url(get_comment_link($comment->comment_ID));
            ?>
">
						<?php 
            printf(__('%1$s at %2$s', 'framemarket'), get_comment_date(), get_comment_time());
            ?>
</a><?php 
            edit_comment_link(__('(Edit)', 'framemarket'), ' ');
            ?>
					</div>

					<div class="comment-body"><?php 
            comment_text();
            ?>
</div>

					<div class="reply">
						<?php 
            comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
            ?>
					</div>
				</div>

		<?php 
        } else {
            $GLOBALS['comment'] = $comment;
            if ('pingback' == $comment->comment_type) {
                return false;
            }
            if (1 == $depth) {
                $avatar_size = 50;
            } else {
                $avatar_size = 25;
            }
            ?>
<li <?php 
            comment_class();
            ?>
 id="li-comment-<?php 
            comment_ID();
            ?>
">
	<div id="comment-<?php 
            comment_ID();
            ?>
">
	<div class="comment-author vcard">
				<a href="<?php 
            echo get_comment_author_url();
            ?>
" rel="nofollow">
					<?php 
            if ($comment->user_id) {
                ?>
							<?php 
                echo get_avatar($comment, 40);
                ?>
					<?php 
            } else {
                ?>
						<?php 
                echo get_avatar($comment, $avatar_size);
                ?>
					<?php 
            }
            ?>
	</div>
		<?php 
            if ($comment->comment_approved == '0') {
                ?>
			<em><?php 
                _e('Your comment is awaiting moderation.', 'framemarket');
                ?>
</em>
			<br />
		<?php 
            }
            ?>

		<div class="comment-meta commentmetadata"><a href="<?php 
            echo esc_url(get_comment_link($comment->comment_ID));
            ?>
">
			<?php 
            printf(__('%1$s at %2$s', 'framemarket'), get_comment_date(), get_comment_time());
            ?>
</a><?php 
            edit_comment_link(__('(Edit)', 'framemarket'), ' ');
            ?>
		</div>

		<div class="comment-body"><?php 
            comment_text();
            ?>
</div>

		<div class="reply">
			<?php 
            comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
            ?>
		</div>
	</div>

<?php 
        }
    }
/**
 * Retrieves the HTML link of the url of the author of the current comment.
 *
 * $linktext parameter is only used if the URL does not exist for the comment
 * author. If the URL does exist then the URL will be used and the $linktext
 * will be ignored.
 *
 * Encapsulate the HTML link between the $before and $after. So it will appear
 * in the order of $before, link, and finally $after.
 *
 * @since 1.5.0
 *
 * @param string $linktext Optional. The text to display instead of the comment
 *                         author's email address. Default empty.
 * @param string $before Optional. The text or HTML to display before the email link.
 *                         Default empty.
 * @param string $after Optional. The text or HTML to display after the email link.
 *                         Default empty.
 * @return string The HTML link between the $before and $after parameters.
 */
function get_comment_author_url_link($linktext = '', $before = '', $after = '')
{
    $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}";
    /**
     * Filter the comment author's returned URL link.
     *
     * @since 1.5.0
     *
     * @param string $return The HTML-formatted comment author URL link.
     */
    return apply_filters('get_comment_author_url_link', $return);
}
		<link rel="alternate" href="<?php 
        comment_link();
        ?>
" type="<?php 
        bloginfo_rss('html_type');
        ?>
" />

		<author>
			<name><?php 
        comment_author_rss();
        ?>
</name>
			<?php 
        if (get_comment_author_url()) {
            echo '<uri>' . get_comment_author_url() . '</uri>';
        }
        ?>

		</author>

		<id><?php 
        comment_guid();
        ?>
</id>
		<updated><?php 
        echo mysql2date('Y-m-d\\TH:i:s\\Z', get_comment_time('Y-m-d H:i:s', true), false);
        ?>
</updated>
		<published><?php 
        echo mysql2date('Y-m-d\\TH:i:s\\Z', get_comment_time('Y-m-d H:i:s', true), false);
Пример #27
0
function qb_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    //$avatar 			= get_avatar( $comment, 48 );
    $comment_author_id = get_comment(get_comment_ID())->user_id;
    $comment_author_url = get_comment_author_url();
    if (has_wp_user_avatar($comment_author_id)) {
        //$avatar	= get_wp_user_avatar_src( $comment_author_id, 48 );
        $avatar = get_wp_user_avatar($comment_author_id, 48);
    } else {
        //$avatar = get_bloginfo( 'template_url' ) . '/images/default/48.png';
        // temporary: this is the same for now, for testing; eventually, it should fall back to default image or Facebook image or smt else
        //$avatar	= get_wp_user_avatar_src( $comment_author_id, 48 );
        $avatar = get_wp_user_avatar($comment_author_id, 48);
    }
    ?>

	<li <?php 
    get_comment_class();
    ?>
><?php 
    if ($comment_author_url) {
        echo '<a href="' . $comment_author_url . '">' . $avatar . get_comment_author() . '</a>';
    } else {
        echo $avatar . get_comment_author();
    }
    echo '<time class="timeago" datetime="' . get_comment_date('c') . '">' . get_comment_date('F j, Y') . '</time>';
    comment_text();
    //edit_comment_link( 'Edit', '<span class="edit">', '</span>' );
    if ($comment->comment_approved == '0') {
        echo '<em class="moderate">Your comment is awaiting moderation.</em>';
    }
    /*comment_reply_link(
    			array_merge(
    				$args,
    				array(
    					'reply_text'	=> 'Reply',
    					'depth' 		=> $depth,
    					'max_depth' 	=> $args['max_depth']
    				)
    			)
    		);*/
    echo '</li>';
}
Пример #28
0
/**
 * Returns a comment author's name, wrapped in a link if present.
 * 
 * It also includes hCard microformat markup.
 * @link http://microformats.org/wiki/hcard
 * 
 * @since 2.0
 * 
 * @global object $comment
 * @return string
 * 
 * @hook filter get_comment_author_link
 * Native WordPress filter on comment author links.
 * @hook filter tarski_comment_author_link
 * Tarski-specific filter on comment author links.
 */
function tarski_comment_author_link()
{
    global $comment;
    $url = get_comment_author_url();
    $author = get_comment_author();
    if (empty($url) || 'http://' == $url) {
        $return = sprintf('<span class="fn">%s</span>', $author);
    } else {
        $return = sprintf('<a class="url fn" href="%1$s" rel="external nofollow">%2$s</a>', $url, $author);
    }
    $return = apply_filters('get_comment_author_link', $return);
    $return = apply_filters('tarski_comment_author_link', $return);
    return $return;
}
Пример #29
0
function get_comment_author_url_link($linktext = '', $before = '', $after = '')
{
    global $comment;
    $url = get_comment_author_url();
    $display = $linktext != '' ? $linktext : $url;
    $return = "{$before}<a href='{$url}' rel='external'>{$display}</a>{$after}";
    return apply_filters('get_comment_author_url_link', $return);
}
 function column_author($comment)
 {
     global $comment_status;
     $author_url = get_comment_author_url();
     if ('http://' == $author_url) {
         $author_url = '';
     }
     $author_url_display = preg_replace('|http://(www\\.)?|i', '', $author_url);
     if (strlen($author_url_display) > 50) {
         $author_url_display = substr($author_url_display, 0, 49) . '...';
     }
     echo "<strong>";
     comment_author();
     echo '</strong><br />';
     if (!empty($author_url)) {
         echo "<a title='{$author_url}' href='{$author_url}'>{$author_url_display}</a><br />";
     }
     if ($this->user_can) {
         if (!empty($comment->comment_author_email)) {
             comment_author_email_link();
             echo '<br />';
         }
         echo '<a href="edit-comments.php?s=';
         comment_author_IP();
         echo '&amp;mode=detail';
         if ('spam' == $comment_status) {
             echo '&amp;comment_status=spam';
         }
         echo '">';
         comment_author_IP();
         echo '</a>';
     }
 }