Unify comment display. Props mdawaffe. fixes #6025
git-svn-id: http://svn.automattic.com/wordpress/trunk@7082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -164,26 +164,41 @@ if ($posts) {
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( 1 == count($posts) && isset( $_GET['page_id'] ) ) {
|
||||
|
||||
if ( 1 == count($posts) && isset( $_GET['page_id'] ) ) :
|
||||
|
||||
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
|
||||
if ($comments) {
|
||||
if ( $comments ) :
|
||||
// Make sure comments, post, and post_author are cached
|
||||
update_comment_cache($comments);
|
||||
$post = get_post($id);
|
||||
$authordata = get_userdata($post->post_author);
|
||||
?>
|
||||
<h3 id="comments"><?php _e('Comments') ?></h3>
|
||||
<ol id="the-comment-list" class="list:comment commentlist">
|
||||
|
||||
<br class="clear" />
|
||||
|
||||
<table class="widefat" style="margin-top: .5em">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php _e('Comment') ?></th>
|
||||
<th scope="col"><?php _e('Date') ?></th>
|
||||
<th scope="col"><?php _e('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="the-comment-list" class="list:comment">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ( $comments as $comment ) {
|
||||
_wp_comment_list_item( $comment->comment_ID, ++$i );
|
||||
}
|
||||
echo '</ol>';
|
||||
} // end if comments
|
||||
foreach ($comments as $comment)
|
||||
_wp_comment_row( $comment->comment_ID, 'detail', false );
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
endif; // comments
|
||||
endif; // posts;
|
||||
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user