Changeset 1355 for trunk/wp-admin/import-textpattern.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import-textpattern.php
r1117 r1355 72 72 <?php 73 73 // 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"; 75 maybe_add_column($wpdb->posts, 'post_name', $query); 76 76 77 77 // Create post_name field … … 80 80 81 81 // 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"); 84 84 85 85 $posts = mysql_query('SELECT * FROM textpattern', $connection); … … 102 102 $post_name = sanitize_title($title); 103 103 104 $wpdb->query("INSERT INTO $ tableposts104 $wpdb->query("INSERT INTO $wpdb->posts 105 105 (post_author, post_date, post_content, post_title, post_category, post_name, post_status) 106 106 VALUES … … 108 108 109 109 // 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"); 111 111 112 112 // Now let's insert comments if there are any for the TP post … … 118 118 // For some reason here "posted" is a real MySQL date, so we don't have to do anything about it 119 119 // 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 $ tablecomments120 $wpdb->query("INSERT INTO $wpdb->comments 121 121 (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content) 122 122 VALUES
Note: See TracChangeset
for help on using the changeset viewer.