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-textpattern.php

    r1117 r1355  
    7272<?php
    7373// For people running this on .72
    74 $query = "ALTER TABLE `$tableposts` ADD `post_name` VARCHAR(200) NOT NULL";
    75 maybe_add_column($tableposts, 'post_name', $query);
     74$query = "ALTER TABLE `$wpdb->posts` ADD `post_name` VARCHAR(200) NOT NULL";
     75maybe_add_column($wpdb->posts, 'post_name', $query);
    7676
    7777// Create post_name field
     
    8080
    8181// For now we're going to give everything the same author and same category
    82 $author = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_level = 10 LIMIT 1");
    83 $category = $wpdb->get_var("SELECT cat_ID FROM $tablecategories LIMIT 1");
     82$author = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_level = 10 LIMIT 1");
     83$category = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories LIMIT 1");
    8484
    8585$posts = mysql_query('SELECT * FROM textpattern', $connection);
     
    102102    $post_name = sanitize_title($title);
    103103
    104     $wpdb->query("INSERT INTO $tableposts
     104    $wpdb->query("INSERT INTO $wpdb->posts
    105105        (post_author, post_date, post_content, post_title, post_category, post_name, post_status)
    106106        VALUES
     
    108108
    109109    // Get wordpress post id
    110     $wp_post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
     110    $wp_post_ID = $wpdb->get_var("SELECT ID FROM $wpdb->posts ORDER BY ID DESC LIMIT 1");
    111111   
    112112    // Now let's insert comments if there are any for the TP post
     
    118118            // For some reason here "posted" is a real MySQL date, so we don't have to do anything about it
    119119            //  comment_post_ID      comment_author      comment_author_email    comment_author_url      comment_author_IP       comment_date    comment_content     comment_karma
    120             $wpdb->query("INSERT INTO $tablecomments
     120            $wpdb->query("INSERT INTO $wpdb->comments
    121121                (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content)
    122122                VALUES
Note: See TracChangeset for help on using the changeset viewer.