- foreach ($comments as $comment) {
- ++$i; $class = '';
- $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
- $comment_status = wp_get_comment_status($comment->comment_ID);
- if ('unapproved' == $comment_status)
- $class .= ' unapproved';
- if ($i % 2)
- $class .= ' alternate';
- echo "<li id='comment-$comment->comment_ID' class='$class'>";
-?>
- <p><strong><?php _e('Name:') ?></strong> <?php comment_author() ?> <?php if ($comment->comment_author_email) { ?>| <strong><?php _e('E-mail:') ?></strong> <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url ) { ?> | <strong><?php _e('URI:') ?></strong> <?php comment_author_url_link() ?> <?php } ?>| <strong><?php _e('IP:') ?></strong> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p>
-
- <?php comment_text() ?>
-
- <p><?php _e('Posted'); echo ' '; comment_date('M j, g:i A');
- if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
- echo " | <a href=\"post.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>";
- echo " | <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars( $comment->comment_author, 1 )) . "' );\">" . __('Delete Comment') . "</a> — ";
- } // end if any comments to show
- // Get post title
- if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
- $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID");
- $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
- ?> <a href="post.php?action=edit&post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post “%s”'), stripslashes($post_title)); ?></a>
- <?php } ?>
- | <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a></p>
- </li>
-
-<?php } // end foreach ?>
-</ol>
+ foreach ( $comments as $comment ) {
+ get_comment( $comment ); // Cache it
+ _wp_comment_list_item( $comment->comment_ID, ++$i );
+ }
+ echo "</ol>\n\n";
+
+if ( $extra_comments ) : ?>
+<div id="extra-comments" style="display:none">
+<ul id="the-extra-comment-list" class="commentlist">
+<?php
+ foreach ( $extra_comments as $comment ) {
+ get_comment( $comment ); // Cache it
+ _wp_comment_list_item( $comment->comment_ID, ++$i );
+ }
+?>
+</ul>
+</div>
+<?php endif; // $extra_comments ?>