Exemplo n.º 1
0
    /**
     * Defines the callback function for use with wp_list_comments(). This function controls
     * how comments are displayed.
    */
    function graphene_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        ?>
		<li id="comment-<?php 
        comment_ID();
        ?>
" <?php 
        comment_class('clearfix');
        ?>
>
			<?php 
        do_action('graphene_before_comment');
        ?>
			
			<?php 
        /* Added support for comment numbering using Greg's Threaded Comment Numbering plugin */
        ?>
			<?php 
        if (function_exists('gtcn_comment_numbering')) {
            gtcn_comment_numbering($comment->comment_ID, $args);
        }
        ?>
			
				<div class="comment-wrap clearfix">
					
					<?php 
        if ($avatar = get_avatar($comment, apply_filters('graphene_gravatar_size', 40))) {
            ?>
						<div class="comment-avatar-wrap">
							<?php 
            echo $avatar;
            ?>
							<?php 
            do_action('graphene_comment_gravatar');
            ?>
						</div>
					<?php 
        }
        ?>
					
					<h5 class="comment-author">
						<cite><?php 
        echo graphene_comment_author_link($comment->user_id);
        ?>
</cite>
						<?php 
        do_action('graphene_comment_author');
        ?>
					</h5>
					<div class="comment-meta">
						<p class="commentmetadata">
							<?php 
        /* translators: %1$s is the comment date, %2$s is the comment time */
        ?>
							<?php 
        printf(__('%1$s at %2$s', 'graphene'), get_comment_date(), get_comment_time());
        ?>
							<span class="timezone"><?php 
        echo '(UTC ' . get_option('gmt_offset') . ')';
        ?>
</span>
							<?php 
        graphene_moderate_comment(get_comment_ID());
        ?>
							<?php 
        edit_comment_link(__('Edit comment', 'graphene'), ' (', ') ');
        ?>
							<span class="comment-permalink"><a href="<?php 
        echo get_comment_link();
        ?>
"><?php 
        _e('Link to this comment', 'graphene');
        ?>
</a></span>
							<?php 
        do_action('graphene_comment_metadata');
        ?>
    
						</p>
						<p class="comment-reply-link">
							<?php 
        comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => __('Reply', 'graphene')));
        ?>
						
							<?php 
        do_action('graphene_comment_replylink');
        ?>
						</p>
						
						<?php 
        do_action('graphene_comment_meta');
        ?>
					</div>
					<div class="comment-entry">
						<?php 
        do_action('graphene_before_commententry');
        ?>
						
						<?php 
        if ($comment->comment_approved == '0') {
            ?>
						   <p><em><?php 
            _e('Your comment is awaiting moderation.', 'graphene');
            ?>
</em></p>
						   <?php 
            do_action('graphene_comment_moderation');
            ?>
						<?php 
        } else {
            ?>
							<?php 
            comment_text();
            ?>
						<?php 
        }
        ?>
						
						<?php 
        do_action('graphene_after_commententry');
        ?>
					</div>
				</div>
			
			<?php 
        do_action('graphene_after_comment');
        ?>
	<?php 
    }
Exemplo n.º 2
0
function mytheme_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    extract($args, EXTR_SKIP);
    if ('div' == $args['style']) {
        $tag = 'div';
        $add_below = 'comment';
    } else {
        $tag = 'li';
        $add_below = 'div-comment';
    }
    $cmntCnt = 1;
    ?>

    <<?php 
    echo $tag;
    ?>
 <?php 
    comment_class(empty($args['has_children']) ? '' : 'parent');
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
    <?php 
    if ('div' != $args['style']) {
        ?>
    <div id="div-comment-<?php 
        comment_ID();
        ?>
" class="comment-body <?php 
        /* Only use the authcomment class from style.css if the user_id is 1 (admin) */
        if (1 | 2 === $comment->user_id) {
            $oddcomment = bypostauthor;
        }
        echo $oddcomment;
        ?>
 author-id-<?php 
        echo $comment->user_id;
        ?>
">
    <?php 
    }
    ?>
    <?php 
    if ($args['avatar_size'] != 0) {
        echo get_avatar($comment, $args['avatar_size']);
    }
    ?>
    <div class="comment-author">
      <?php 
    printf(__('%s'), get_comment_author_link());
    ?>
      <div class="comment-meta commentmetadata"><a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
">
        <?php 
    /* translators: 1: date, 2: time */
    printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time());
    ?>
</a><?php 
    edit_comment_link(__('(Edit)'), '  ', '');
    ?>
      </div>
      <a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
" class="comment-parent-count"><?php 
    $comment_number = gtcn_comment_numbering($comment->comment_ID, $args);
    echo $comment_number;
    ?>
</a>
    </div>
<?php 
    if ($comment->comment_approved == '0') {
        ?>
    <em class="comment-awaiting-moderation"><?php 
        _e('Your comment is awaiting moderation.');
        ?>
</em>
    <br />
<?php 
    }
    ?>



    <?php 
    comment_text();
    ?>

    <div class="reply">
    <?php 
    comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
    </div>
    <?php 
    if ('div' != $args['style']) {
        ?>
    </div>
    <?php 
    }
}
Exemplo n.º 3
0
function comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>


<?php 
    if ($comment->comment_author_email == get_the_author_email()) {
        $commentDivClass = 'comment-admin';
    } else {
        $commentDivClass = 'comment-normal';
    }
    ?>

	<div class="mod comments <?php 
    echo $commentDivClass;
    ?>
">
		<div <?php 
    comment_class();
    ?>
>
			<div id="comment-<?php 
    comment_ID();
    ?>
">
				<div class="mod-meta comment-author">
					<a class="comment-number" href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    echo gtcn_comment_numbering($comment->comment_ID, '');
    ?>
</a>
					<a class="comment-gravatar" href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    echo get_avatar($comment, $size = '35');
    ?>
</a>
					<div class="clear"></div>
				</div>

				<div class="mod-body">
					<div class="entry">
						<?php 
    if ($comment->comment_approved == '0') {
        ?>
							<em><?php 
        _e('Your comment is awaiting moderation.');
        ?>
</em>
						<?php 
    }
    ?>

						<div class="comment-meta commentmetadata"><?php 
    printf(__('<strong>%s</strong>'), get_comment_author_link());
    ?>
<span class="date"><?php 
    if (!function_exists('how_long_ago')) {
        comment_date() . ' at ' . comment_time();
    } else {
        echo how_long_ago(get_comment_time('U'));
    }
    ?>
</span><?php 
    edit_comment_link(__('Edit'), '<span class="edit">', '</span>');
    ?>
</div>

						<?php 
    comment_text();
    ?>

						<div class="reply"><?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
</div>
					</div> <!-- end div.entry -->
				</div> <!-- end div.mod-body -->
			</div> <!-- end #comment-ID -->
			<div class="clear"></div>
		</div> <!-- end div.comment -->
<?php 
}
function afn_numbered_comments()
{
    if (function_exists('gtcn_comment_numbering')) {
        echo gtcn_comment_numbering($comment->comment_ID, $args);
    }
}