コード例 #1
0
ファイル: discussion.php プロジェクト: kosir/thatcamp-org
/**
 * Custom callback function to list comments in the Thematic style. 
 * 
 * If you want to use your own comments callback for wp_list_comments, filter list_comments_arg
 *
 * @param object $comment 
 * @param array $args 
 * @param int $depth 
 */
function thematic_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    $GLOBALS['comment_depth'] = $depth;
    ?>
    
       	<li id="comment-<?php 
    comment_ID();
    ?>
" <?php 
    comment_class();
    ?>
>
    	
    		<?php 
    // action hook for inserting content above #comment
    thematic_abovecomment();
    ?>
    		
    		<div class="comment-author vcard"><?php 
    thematic_commenter_link();
    ?>
</div>
    		
    			<?php 
    thematic_commentmeta(TRUE);
    ?>
    		
    			<?php 
    if ($comment->comment_approved == '0') {
        echo "\t\t\t\t\t" . '<span class="unapproved">';
        _e('Your comment is awaiting moderation', 'thematic');
        echo ".</span>\n";
    }
    ?>
    			
            <div class="comment-content">
            
        		<?php 
    comment_text();
    ?>
        		
    		</div>
    		
			<?php 
    // echo the comment reply link with help from Justin Tadlock http://justintadlock.com/ and Will Norris http://willnorris.com/
    if ($args['type'] == 'all' || get_comment_type() == 'comment') {
        comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'thematic'), 'login_text' => __('Log in to reply.', 'thematic'), 'depth' => $depth, 'before' => '<div class="comment-reply-link">', 'after' => '</div>')));
    }
    ?>
			
			<?php 
    // action hook for inserting content above #comment
    thematic_belowcomment();
    ?>

<?php 
}
コード例 #2
0
function thematic_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    $GLOBALS['comment_depth'] = $depth;
    ?>
    	<li id="comment-<?php 
    comment_ID();
    ?>
" class="<?php 
    thematic_comment_class();
    ?>
">
    		<div class="comment-author vcard"><?php 
    thematic_commenter_link();
    ?>
</div>
    		<div class="comment-meta"><?php 
    printf(__('Posted %1$s at %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'thematic'), get_comment_date(), get_comment_time(), '#comment-' . get_comment_ID());
    edit_comment_link(__('Edit', 'thematic'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>');
    ?>
</div>
    <?php 
    if ($comment->comment_approved == '0') {
        _e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'thematic');
    }
    ?>
            <div class="comment-content">
        		<?php 
    comment_text();
    ?>
    		</div>
			<?php 
    // echo the comment reply link with help from Justin Tadlock http://justintadlock.com/ and Will Norris http://willnorris.com/
    if ($args['type'] == 'all' || get_comment_type() == 'comment') {
        comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'thematic'), 'login_text' => __('Log in to reply.', 'thematic'), 'depth' => $depth, 'before' => '<div class="comment-reply-link">', 'after' => '</div>')));
    }
}
コード例 #3
0
function vegpledge_print_pledge($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    $GLOBALS['comment_depth'] = $depth;
    ?>
<li id="comment-<?php 
    comment_ID();
    ?>
" class="<?php 
    thematic_comment_class();
    ?>
">
    <span class="comment-author vcard"><?php 
    thematic_commenter_link();
    ?>
</span>
    <span class="comment-meta">
<?php 
    printf(__('Pledged %1$s at %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Link to This VegPledge">Link</a>', 'thematic'), get_comment_date(), get_comment_time(), '#comment-' . get_comment_ID());
    edit_comment_link(__('Edit', 'thematic'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>');
    ?>
    </span>
<?php 
    if ($comment->comment_approved == '0') {
        _e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'thematic');
    }
    ?>
    <div id="vegpledge-list-pledges">
        <ul>
<?php 
    foreach (vegpledge_get_comment_pledges(get_comment_ID()) as $pledge_id => $pledge) {
        ?>
            <li class="mini-pledge mini-pledge-<?php 
        echo $pledge_id;
        ?>
">
                <?php 
        echo esc_html($pledge);
        ?>
            </li>
<?php 
    }
    ?>
        </ul>
    </div>
    <div class="comment-content">
        <?php 
    comment_text();
    ?>
    </div>
<?php 
}