Changeset 1355 for trunk/wp-admin/import-rss.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import-rss.php
r1264 r1355 125 125 // So we do it as a last resort 126 126 if ('' == $title) : 127 $dupe = $wpdb->get_var("SELECT ID FROM $ tableposts WHERE post_content = '$content' AND post_date = '$post_date'");127 $dupe = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_content = '$content' AND post_date = '$post_date'"); 128 128 else : 129 $dupe = $wpdb->get_var("SELECT ID FROM $ tableposts WHERE post_title = '$title' AND post_date = '$post_date'");129 $dupe = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$title' AND post_date = '$post_date'"); 130 130 endif; 131 131 … … 135 135 else : 136 136 137 $wpdb->query("INSERT INTO $ tableposts137 $wpdb->query("INSERT INTO $wpdb->posts 138 138 (post_author, post_date, post_date_gmt, post_content, post_title,post_status, comment_status, ping_status, post_name) 139 139 VALUES 140 140 ('$post_author', '$post_date', DATE_ADD('$post_date', INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE), '$content', '$title', 'publish', '$comment_status', '$ping_status', '$post_name')"); 141 $post_id = $wpdb->get_var("SELECT ID FROM $ tableposts WHERE post_title = '$title' AND post_date = '$post_date'");141 $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$title' AND post_date = '$post_date'"); 142 142 if (!$post_id) die("couldn't get post ID"); 143 143 if (0 != count($categories)) : … … 145 145 $post_category = unhtmlentities($post_category); 146 146 // See if the category exists yet 147 $cat_id = $wpdb->get_var("SELECT cat_ID from $ tablecategories WHERE cat_name = '$post_category'");147 $cat_id = $wpdb->get_var("SELECT cat_ID from $wpdb->categories WHERE cat_name = '$post_category'"); 148 148 if (!$cat_id && '' != trim($post_category)) { 149 149 $cat_nicename = sanitize_title($post_category); 150 $wpdb->query("INSERT INTO $ tablecategories (cat_name, category_nicename) VALUES ('$post_category', '$cat_nicename')");151 $cat_id = $wpdb->get_var("SELECT cat_ID from $ tablecategories WHERE cat_name = '$post_category'");150 $wpdb->query("INSERT INTO $wpdb->categories (cat_name, category_nicename) VALUES ('$post_category', '$cat_nicename')"); 151 $cat_id = $wpdb->get_var("SELECT cat_ID from $wpdb->categories WHERE cat_name = '$post_category'"); 152 152 } 153 153 if ('' == trim($post_category)) $cat_id = 1; 154 154 // Double check it's not there already 155 $exists = $wpdb->get_row("SELECT * FROM $ tablepost2cat WHERE post_id = $post_id AND category_id = $cat_id");155 $exists = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post_id AND category_id = $cat_id"); 156 156 157 157 if (!$exists) { 158 158 $wpdb->query(" 159 INSERT INTO $ tablepost2cat159 INSERT INTO $wpdb->post2cat 160 160 (post_id, category_id) 161 161 VALUES … … 165 165 endforeach; 166 166 else: 167 $exists = $wpdb->get_row("SELECT * FROM $ tablepost2cat WHERE post_id = $post_id AND category_id = 1");168 if (!$exists) $wpdb->query("INSERT INTO $ tablepost2cat (post_id, category_id) VALUES ($post_id, 1) ");167 $exists = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post_id AND category_id = 1"); 168 if (!$exists) $wpdb->query("INSERT INTO $wpdb->post2cat (post_id, category_id) VALUES ($post_id, 1) "); 169 169 endif; 170 170 echo 'Done!</li>';
Note: See TracChangeset
for help on using the changeset viewer.