Make WordPress Core


Ignore:
Timestamp:
05/24/2004 08:22:18 AM (21 years ago)
Author:
saxmatt
Message:

Giant commit, sorry mailing list people. Move all table names to new $wpdb versions. Works but the whole app needs thorough testing now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r1271 r1355  
    4646    foreach ($delete_comments as $comment) { // Check the permissions on each
    4747        $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"));
    5050        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");
    5252            ++$i;
    5353        }
     
    5858if (isset($_GET['s'])) {
    5959    $s = $wpdb->escape($_GET['s']);
    60     $comments = $wpdb->get_results("SELECT * FROM $tablecomments  WHERE
     60    $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments  WHERE
    6161        comment_author LIKE '%$s%' OR
    6262        comment_author_email LIKE '%$s%' OR
     
    6666        ORDER BY comment_date DESC");
    6767} 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");
    6969}
    7070if ('view' == $mode) {
     
    7272        echo '<ol>';
    7373        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"));
    7575            $comment_status = wp_get_comment_status($comment->comment_ID);
    7676            if ('unapproved' == $comment_status) {
     
    9090            } // end if any comments to show
    9191            // 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");
    9393            $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
    9494            ?> <a href="post.php?action=edit&amp;post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post &#8220;%s&#8221;'), stripslashes($post_title)); ?></a> | <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a></p>
     
    120120  </tr>';
    121121        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"));
    123123        $bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee';
    124124?>
Note: See TracChangeset for help on using the changeset viewer.