- $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
- if ($comments) {
- ?>
-<h3><?php _e('Comments') ?></h3>
-<ol id="comments">
-<?php
-foreach ($comments as $comment) {
-$comment_status = wp_get_comment_status($comment->comment_ID);
-?>
-
-<li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?> >
- <?php comment_date('Y-n-j') ?>
- @
- <?php comment_time('g:m:s a') ?>
- <?php
- if ( current_user_can('edit_post', $post->ID) ) {
- echo "[ <a href=\"post.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit') . "</a>";
- echo ' - <a href="' . wp_nonce_url('post.php?action=deletecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return confirm(\'' . __("You are about to delete this comment.\\n"Cancel" to stop, "OK" to delete.") . "');\">" . __('Delete') . '</a> ';
-
- if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
- if ('approved' == wp_get_comment_status($comment->comment_ID)) {
- echo ' - <a href="' . wp_nonce_url('post.php?action=unapprovecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '">' . __('Unapprove') . '</a> ';
- } else {
- echo ' - <a href="' . wp_nonce_url('post.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '">' . __('Approve') . '</a> ';
- }
- }
- echo "]";
- } // end if any comments to show
- ?>
- <br />
- <strong>
- <?php comment_author() ?>
- (
- <?php comment_author_email_link() ?>
- /
- <?php comment_author_url_link() ?>
- )</strong> (IP:
- <?php comment_author_IP() ?>
- )
- <?php comment_text() ?>
-
-</li>
-<!-- /comment -->
-<?php //end of the loop, don't delete
- } // end foreach
- echo '</ol>';
- }//end if comments
- ?>
-<?php } ?>
-</div>
-<?php
- include('admin-footer.php');
-?>