Changeset 1355 for trunk/wp-admin/edit-comments.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-comments.php
r1271 r1355 46 46 foreach ($delete_comments as $comment) { // Check the permissions on each 47 47 $comment = intval($comment); 48 $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $ tablecomments WHERE comment_ID = $comment");49 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $ tableposts WHERE ID = $post_id"));48 $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); 49 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id")); 50 50 if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { 51 $wpdb->query("DELETE FROM $ tablecomments WHERE comment_ID = $comment");51 $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_ID = $comment"); 52 52 ++$i; 53 53 } … … 58 58 if (isset($_GET['s'])) { 59 59 $s = $wpdb->escape($_GET['s']); 60 $comments = $wpdb->get_results("SELECT * FROM $ tablecomments WHERE60 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE 61 61 comment_author LIKE '%$s%' OR 62 62 comment_author_email LIKE '%$s%' OR … … 66 66 ORDER BY comment_date DESC"); 67 67 } else { 68 $comments = $wpdb->get_results("SELECT * FROM $ tablecomments ORDER BY comment_date DESC LIMIT 20");68 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments ORDER BY comment_date DESC LIMIT 20"); 69 69 } 70 70 if ('view' == $mode) { … … 72 72 echo '<ol>'; 73 73 foreach ($comments as $comment) { 74 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $ tableposts WHERE ID = $comment->comment_post_ID"));74 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); 75 75 $comment_status = wp_get_comment_status($comment->comment_ID); 76 76 if ('unapproved' == $comment_status) { … … 90 90 } // end if any comments to show 91 91 // Get post title 92 $post_title = $wpdb->get_var("SELECT post_title FROM $ tableposts WHERE ID = $comment->comment_post_ID");92 $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"); 93 93 $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; 94 94 ?> <a href="post.php?action=edit&post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post “%s”'), stripslashes($post_title)); ?></a> | <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a></p> … … 120 120 </tr>'; 121 121 foreach ($comments as $comment) { 122 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $ tableposts WHERE ID = $comment->comment_post_ID"));122 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); 123 123 $bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee'; 124 124 ?>
Note: See TracChangeset
for help on using the changeset viewer.