예제 #1
0
if ( post_password_required() || ( !have_comments() && !comments_open() && !pings_open() ) )
	return;
?>

<div id="comments-template">

	<?php if ( have_comments() ) : ?>

		<div id="comments">
			
			<h3 id="comments-number" class="comments-header"><?php comments_number( sprintf( __( 'No responses to %1$s', hybrid_get_parent_textdomain() ), the_title( '&#8220;', '&#8221;', false ) ), sprintf( __( 'One response to %1$s', hybrid_get_parent_textdomain() ), the_title( '&#8220;', '&#8221;', false ) ), sprintf( __( '%1$s responses to %2$s', hybrid_get_parent_textdomain() ), '%', the_title( '&#8220;', '&#8221;', false ) ) ); ?></h3>

			<?php do_atomic( 'before_comment_list' ); // Before comment list hook ?>
			
			<ul class="comment-list">
				<?php wp_list_comments( hybrid_list_comments_args() ); ?>
			</ul><!-- .comment-list -->

			<?php do_atomic( 'after_comment_list' ); // After comment list hook ?>

			<?php if ( get_option( 'page_comments' ) ) : ?>
				<div class="comment-navigation comment-pagination paged-navigation">
					<?php paginate_comments_links(); ?>
				</div><!-- .comment-navigation -->
			<?php endif; ?>

		</div><!-- #comments -->

	<?php else : ?>

		<?php if ( pings_open() && !comments_open() ) : ?>
예제 #2
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
 * @global $comment The current comment's DB object.
 * @global $hybrid The global Hybrid object.
 */
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 = esc_html( get_comment_author( $comment->comment_ID ) );
	$url = esc_url( get_comment_author_url( $comment->comment_ID ) );

	/* 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( get_comment_author_email( $comment->comment_ID ), absint( $size ), $default_avatar, $author );

	/* If URL input, wrap avatar in hyperlink. */
	if ( !empty( $url ) )
		$avatar = '<a href="' . $url . '" rel="external nofollow" title="' . $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 );
}
예제 #3
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);
}
예제 #4
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 THEME_IMAGES . "/{$comment_type}.png" for the default avatars for
 * trackbacks and pingbacks.
 *
 * @since 0.2
 * @global $comment The current comment's DB object.
 * @global $hybrid The global Hybrid object.
 */
function hybrid_avatar() {
	global $comment, $hybrid;

	if ( !get_option( 'show_avatars' ) )
		return false;

	/* Get/set some comment variables. */
	$comment_type = get_comment_type( $comment->comment_ID );
	$author = esc_html( get_comment_author( $comment->comment_ID ) );
	$url = esc_url( get_comment_author_url( $comment->comment_ID ) );

	if ( 'pingback' == $comment_type || 'trackback' == $comment_type ) 
		$default_avatar = THEME_IMAGES . "/{$comment_type}.png";

	$default_avatar = apply_filters( "{$hybrid->prefix}_{$comment_type}_avatar", $default_avatar );

	$comment_list_args = hybrid_list_comments_args();
	$size = ( ( $comment_list_args['avatar_size'] ) ? $comment_list_args['avatar_size'] : 80 );

	$avatar = get_avatar( get_comment_author_email( $comment->comment_ID ), absint( $size ), $default_avatar, $author );

	/* If URL input, wrap avatar in hyperlink. */
	if ( $url )
		$avatar = '<a href="' . $url . '" rel="external nofollow" title="' . $author . '">' . $avatar . '</a>';

	echo apply_filters( "{$hybrid->prefix}_avatar", $avatar );
}