Changeset 1355 for trunk/wp-admin/import-greymatter.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import-greymatter.php
r1190 r1355 88 88 $user_joindate=addslashes($user_joindate); 89 89 90 $loginthere = $wpdb->get_var("SELECT user_login FROM $ tableusers WHERE user_login = '$user_login'");90 $loginthere = $wpdb->get_var("SELECT user_login FROM $wpdb->users WHERE user_login = '$user_login'"); 91 91 if ($loginthere) { 92 92 echo "<li>user <i>$user_login</i>... <b>Already exists</b></li>"; … … 94 94 } 95 95 96 $query = "INSERT INTO $ tableusers (user_login,user_pass,user_nickname,user_email,user_url,user_ip,user_domain,user_browser,dateYMDhour,user_level,user_idmode) VALUES ('$user_login','$pass1','$user_nickname','$user_email','$user_url','$user_ip','$user_domain','$user_browser','$user_joindate','1','nickname')";96 $query = "INSERT INTO $wpdb->users (user_login,user_pass,user_nickname,user_email,user_url,user_ip,user_domain,user_browser,dateYMDhour,user_level,user_idmode) VALUES ('$user_login','$pass1','$user_nickname','$user_email','$user_url','$user_ip','$user_domain','$user_browser','$user_joindate','1','nickname')"; 97 97 $result = mysql_query($query); 98 98 if ($result==false) { … … 140 140 $post_author=trim(addslashes($postinfo[1])); 141 141 // we'll check the author is registered, or if it's a deleted author 142 $sql = "SELECT * FROM $ tableusers WHERE user_login = '$post_author'";142 $sql = "SELECT * FROM $wpdb->users WHERE user_login = '$post_author'"; 143 143 $result = mysql_query($sql); 144 144 if (!mysql_num_rows($result)) { // if deleted from GM, we register the author as a level 0 user in b2 … … 153 153 $user_url=addslashes(""); 154 154 $user_joindate=addslashes($user_joindate); 155 $query = "INSERT INTO $ tableusers (user_login,user_pass,user_nickname,user_email,user_url,user_ip,user_domain,user_browser,dateYMDhour,user_level,user_idmode) VALUES ('$user_login','$pass1','$user_nickname','$user_email','$user_url','$user_ip','$user_domain','$user_browser','$user_joindate','0','nickname')";155 $query = "INSERT INTO $wpdb->users (user_login,user_pass,user_nickname,user_email,user_url,user_ip,user_domain,user_browser,dateYMDhour,user_level,user_idmode) VALUES ('$user_login','$pass1','$user_nickname','$user_email','$user_url','$user_ip','$user_domain','$user_browser','$user_joindate','0','nickname')"; 156 156 $result = mysql_query($query); 157 157 if ($result==false) { … … 161 161 } 162 162 163 $sql = "SELECT * FROM $ tableusers WHERE user_login = '$post_author'";163 $sql = "SELECT * FROM $wpdb->users WHERE user_login = '$post_author'"; 164 164 $result = mysql_query($sql); 165 165 $myrow = mysql_fetch_array($result); … … 188 188 $post_karma=$postinfo[12]; 189 189 190 $query = "INSERT INTO $ tableposts (post_author,post_date,post_content,post_title) VALUES ('$post_author_ID','$post_date','$post_content','$post_title')";190 $query = "INSERT INTO $wpdb->posts (post_author,post_date,post_content,post_title) VALUES ('$post_author_ID','$post_date','$post_content','$post_title')"; 191 191 $result = mysql_query($query) or die(mysql_error()); 192 192 … … 194 194 die ("Error in posting..."); 195 195 196 $sql2 = "SELECT * FROM $ tableposts WHERE 1=1 ORDER BY ID DESC LIMIT 1";196 $sql2 = "SELECT * FROM $wpdb->posts WHERE 1=1 ORDER BY ID DESC LIMIT 1"; 197 197 $result2 = mysql_query($sql2); 198 198 $myrow2 = mysql_fetch_array($result2); … … 200 200 201 201 // Grab a default category. 202 $post_category = $wpdb->get_var("SELECT cat_ID FROM $ tablecategories LIMIT 1");202 $post_category = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories LIMIT 1"); 203 203 204 204 // Update the post2cat table. 205 $exists = $wpdb->get_row("SELECT * FROM $ tablepost2cat WHERE post_id = $post_ID AND category_id = $post_category");205 $exists = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post_ID AND category_id = $post_category"); 206 206 207 207 if (!$exists) { 208 208 $wpdb->query(" 209 INSERT INTO $ tablepost2cat209 INSERT INTO $wpdb->post2cat 210 210 (post_id, category_id) 211 211 VALUES … … 237 237 $comment_content=addslashes($commentinfo[12]); 238 238 239 $sql3 = "INSERT INTO $ tablecomments (comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_author_IP,comment_date,comment_content) VALUES ('$comment_post_ID','$comment_author','$comment_author_email','$comment_author_url','$comment_author_IP','$comment_date','$comment_content')";239 $sql3 = "INSERT INTO $wpdb->comments (comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_author_IP,comment_date,comment_content) VALUES ('$comment_post_ID','$comment_author','$comment_author_email','$comment_author_url','$comment_author_IP','$comment_date','$comment_content')"; 240 240 $result3 = mysql_query($sql3); 241 241 if (!$result3)
Note: See TracChangeset
for help on using the changeset viewer.