| 259 | | |
| 260 | | $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); |
| 261 | | if ($comments) { |
| 262 | | ?> |
| 263 | | <h3 id="comments"><?php _e('Comments') ?></h3> |
| 264 | | <ol id="the-comment-list" class="commentlist"> |
| 265 | | <?php |
| 266 | | $i = 0; |
| 267 | | foreach ($comments as $comment) { |
| 268 | | |
| 269 | | ++$i; $class = ''; |
| 270 | | $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); |
| 271 | | $comment_status = wp_get_comment_status($comment->comment_ID); |
| 272 | | if ('unapproved' == $comment_status) |
| 273 | | $class .= ' unapproved'; |
| 274 | | if ($i % 2) |
| 275 | | $class .= ' alternate'; |
| 276 | | echo "<li id='comment-$comment->comment_ID' class='$class'>"; |
| 277 | | ?> |
| 278 | | <p><strong><?php comment_author() ?></strong> <?php if ($comment->comment_author_email) { ?>| <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link() ?> <?php } ?>| <?php _e('IP:') ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p> |
| 279 | | |
| 280 | | <?php comment_text() ?> |
| 281 | | |
| 282 | | <p><?php comment_date(__('M j, g:i A')); ?> — [ |
| 283 | | <?php |
| 284 | | if ( current_user_can('edit_post', $comment->comment_post_ID) ) { |
| 285 | | echo " <a href='comment.php?action=editcomment&c=".$comment->comment_ID."'>" . __('Edit') . '</a>'; |
| 286 | | echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; |
| 287 | | if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { |
| 288 | | echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; |
| 289 | | echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; |
| | 260 | if ( isset( $_GET['apage'] ) ) { |
| | 261 | $page = (int) $_GET['apage']; |
| | 262 | } else { |
| | 263 | $page = 1; |