Exemplo n.º 1
0
function p2_comments( $comment, $args ) {
	$GLOBALS['comment'] = $comment;

	if ( !is_single() && get_comment_type() != 'comment' )
		return;

	$depth          = prologue_get_comment_depth( get_comment_ID() );
	$can_edit_post  = current_user_can( 'edit_post', $comment->comment_post_ID );

	$reply_link     = prologue_get_comment_reply_link(
		array( 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => ' | ', 'reply_text' => __( 'Reply', 'p2' ) ),
		$comment->comment_ID, $comment->comment_post_ID );

	$content_class  = 'commentcontent';
	if ( $can_edit_post )
		$content_class .= ' comment-edit';

	?>
	<li id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
		<?php do_action( 'p2_comment' ); ?>

		<?php echo get_avatar( $comment, 32 ); ?>
		<h4>
			<?php echo get_comment_author_link(); ?>
			<span class="meta">
				<?php echo p2_date_time_with_microformat( 'comment' ); ?>
				<span class="actions">
					<a class="thepermalink" href="<?php echo esc_url( get_comment_link() ); ?>" title="<?php esc_attr_e( 'Permalink', 'p2' ); ?>"><?php _e( 'Permalink', 'p2' ); ?></a>
					<?php
					echo $reply_link;

					if ( $can_edit_post )
						edit_comment_link( __( 'Edit', 'p2' ), ' | ' );

					?>
				</span>
			</span>
		</h4>
		<div id="commentcontent-<?php comment_ID(); ?>" class="<?php echo esc_attr( $content_class ); ?>"><?php
				echo apply_filters( 'comment_text', $comment->comment_content, $comment );

				if ( $comment->comment_approved == '0' ): ?>
					<p><em><?php esc_html_e( 'Your comment is awaiting moderation.', 'p2' ); ?></em></p>
				<?php endif; ?>
		</div>
	<?php
}
Exemplo n.º 2
0
function prologue_comment_frontpage($comment, $args, $echocomment = true)
{
    $GLOBALS['comment'] = $comment;
    $depth = prologue_get_comment_depth(get_comment_ID());
    $comment_text = apply_filters('comment_text', $comment->comment_content);
    $thiscomment = '<li ' . comment_class($class = '', $comment_id = null, $post_id = null, $echo = false) . ' id="comment-' . get_comment_ID() . '">' . prologue_get_avatar($comment->user_id, $comment->comment_author_email, 32) . '<h4>
					' . get_comment_author_link() . ' <span class="meta">' . get_comment_time() . ' <em>on</em> ' . get_comment_date() . '<span class="actions"><a href="' . get_permalink() . '#comment-' . get_comment_ID() . '">Permalink</a>' . prologue_get_comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => ' | ', 'reply_text' => 'Reply'), $comment->comment_ID, $comment->comment_post_ID);
    if (current_user_can('edit_post', $comment->comment_post_ID)) {
        $thiscomment .= ' | <a class="comment-edit-link" href="' . get_edit_comment_link($comment->comment_ID) . '" title="' . __('Edit comment') . '">Edit</a>';
    }
    $thiscomment .= '</span><br /></span></h4>';
    $thiscomment .= '<div class="commentcontent';
    if (current_user_can('edit_post', $comment->comment_post_ID)) {
        $thiscomment .= ' comment-edit';
    }
    $thiscomment .= '" id="commentcontent-' . get_comment_ID() . '">' . $comment_text;
    if ($comment->comment_approved == '0') {
        $thiscomment .= '<p><em>' . _('Your comment is awaiting moderation.') . '</em></p>';
    }
    $thiscomment .= '</div>';
    if ($echocomment) {
        echo $thiscomment;
    } else {
        return $thiscomment;
    }
}
Exemplo n.º 3
0
function p2_comments($comment, $args, $echo = true)
{
    $GLOBALS['comment'] = $comment;
    $depth = prologue_get_comment_depth(get_comment_ID());
    $comment_text = apply_filters('comment_text', $comment->comment_content);
    $comment_class = comment_class('', null, null, false);
    $comment_time = get_comment_time();
    $comment_date = get_comment_date();
    $id = get_comment_ID();
    $avatar = get_avatar($comment, 32);
    $author_link = get_comment_author_link();
    $reply_link = prologue_get_comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => ' | ', 'reply_text' => __('Reply', 'p2')), $comment->comment_ID, $comment->comment_post_ID);
    $can_edit = current_user_can('edit_post', $comment->comment_post_ID);
    $edit_comment_url = get_edit_comment_link($comment->comment_ID);
    $edit_link = $can_edit ? " | <a class='comment-edit-link' href='{$edit_comment_url}' title='" . esc_attr__('Edit comment', 'p2') . "'>" . __('Edit', 'p2') . "</a>" : '';
    $content_class = $can_edit ? 'commentcontent comment-edit' : 'commentcontent';
    $awaiting_message = $comment->comment_approved == '0' ? '<p><em>' . __('Your comment is awaiting moderation.', 'p2') . '</em></p>' : '';
    $permalink = esc_url(get_comment_link());
    $permalink_text = __('Permalink', 'p2');
    $date_time = p2_date_time_with_microformat('comment');
    $html = <<<HTML
<li {$comment_class} id="comment-{$id}">
\t\t{$avatar}
\t\t<h4>
\t\t\t\t{$author_link}
\t\t\t\t<span class="meta">
\t\t\t\t\t\t{$date_time}
\t\t\t\t\t\t<span class="actions"><a href="{$permalink}">{$permalink_text}</a> {$reply_link} {$edit_link}</span>
\t\t\t\t</span>
\t\t</h4>
\t\t<div class="{$content_class}" id="commentcontent-{$id}">
\t\t\t\t{$comment_text}
\t\t</div>
HTML;
    if (!is_single() && get_comment_type() != 'comment') {
        return false;
    }
    if ($echo) {
        echo $html;
    } else {
        return $html;
    }
}
Exemplo n.º 4
0
function prologue_comment_frontpage($comment, $args, $echocomment = true)
{
    $GLOBALS['comment'] = $comment;
    $depth = prologue_get_comment_depth(get_comment_ID());
    $comment_text = apply_filters('comment_text', $comment->comment_content);
    $comment_class = comment_class($class = '', $comment_id = null, $post_id = null, $echo = false);
    $comment_time = get_comment_time();
    $comment_date = get_comment_date();
    $id = get_comment_ID();
    $avatar = prologue_get_avatar($comment->user_id, $comment->comment_author_email, 32);
    $author_link = get_comment_author_link();
    $reply_link = prologue_get_comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => ' | ', 'reply_text' => __('Reply', 'p2')), $comment->comment_ID, $comment->comment_post_ID);
    $can_edit = current_user_can('edit_post', $comment->comment_post_ID);
    $edit_comment_url = get_edit_comment_link($comment->comment_ID);
    $edit_link = $can_edit ? " | <a class='comment-edit-link' href='{$edit_comment_url}' title='" . attribute_escape(__('Edit comment', 'p2')) . "'>" . __('Edit', 'p2') . "</a>" : '';
    $content_class = $can_edit ? 'commentcontent comment-edit' : 'commentcontent';
    $awaiting_message = $comment->comment_approved == '0' ? '<p><em>' . __('Your comment is awaiting moderation.', 'p2') . '</em></p>' : '';
    $permalink = clean_url(get_comment_link());
    $permalink_text = __('Permalink', 'p2');
    $date_time = sprintf(__('%s <em>on</em> %s', 'p2'), get_comment_time(), get_comment_date());
    $html = <<<HTML
<li {$comment_class} id="comment-{$id}">
    {$avatar}
    <h4>
        {$author_link}
        <span class="meta">
            {$date_time}
            <span class="actions"><a href="{$permalink}">{$permalink_text}</a> {$reply_link} {$edit_link}</span><br />
        </span>
    </h4>
    <div class="{$content_class}" id="commentcontent-{$id}">
        {$comment_text}
    </div>
HTML;
    if ($echocomment) {
        echo $html;
    } else {
        return $html;
    }
}