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/import-blogger.php

    r1285 r1355  
    6464            $post_author = trim(addslashes($postinfo[1]));
    6565            // we'll check the author is registered already
    66             $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE user_login = '$post_author'");
     66            $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_login = '$post_author'");
    6767            if (!$user) { // seems s/he's not, so let's register
    6868                $user_ip = '127.0.0.1';
     
    7777                $user_joindate = addslashes($user_joindate);
    7878                $result = $wpdb->query("
    79                 INSERT INTO $tableusers (
     79                INSERT INTO $wpdb->users (
    8080                    user_login,
    8181                    user_pass,
     
    106106            }
    107107
    108             $post_author_ID = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_login = '$post_author'");
     108            $post_author_ID = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_login = '$post_author'");
    109109
    110110            $post_date = explode(' ', $post_date);
     
    129129           
    130130            // Quick-n-dirty check for dups:
    131             $dupcheck = $wpdb->get_results("SELECT ID,post_date,post_title FROM $tableposts WHERE post_date='$post_date' AND post_title='$post_title' LIMIT 1",ARRAY_A);
     131            $dupcheck = $wpdb->get_results("SELECT ID,post_date,post_title FROM $wpdb->posts WHERE post_date='$post_date' AND post_title='$post_title' LIMIT 1",ARRAY_A);
    132132            if ($dupcheck[0]['ID']) {
    133133                print "<br />\nSkipping duplicate post, ID = '" . $dupcheck[0]['ID'] . "'<br />\n";
     
    138138
    139139            $result = $wpdb->query("
    140             INSERT INTO $tableposts
     140            INSERT INTO $wpdb->posts
    141141                (post_author,post_date,post_content,post_title,post_category)
    142142            VALUES
     
    152152    /* we've still got a bug that adds some empty posts with the date 0000-00-00 00:00:00
    153153       here's the bugfix: */
    154     $result = $wpdb->query("DELETE FROM $tableposts WHERE post_date=\"0000-00-00 00:00:00\"");
     154    $result = $wpdb->query("DELETE FROM $wpdb->posts WHERE post_date=\"0000-00-00 00:00:00\"");
    155155
    156156    upgrade_all();
Note: See TracChangeset for help on using the changeset viewer.