Changeset 1355 for trunk/wp-admin/import-livejournal.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import-livejournal.php
r1147 r1355 95 95 96 96 // Now lets put it in the DB 97 if ($wpdb->get_var("SELECT ID FROM $ tableposts WHERE post_title = '$title' AND post_date = '$post_date'")) :97 if ($wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$title' AND post_date = '$post_date'")) : 98 98 echo 'Post already imported'; 99 99 else : 100 100 101 $wpdb->query("INSERT INTO $ tableposts101 $wpdb->query("INSERT INTO $wpdb->posts 102 102 (post_author, post_date, post_date_gmt, post_content, post_title,post_status, comment_status, ping_status, post_name) 103 103 VALUES 104 104 ('$post_author', '$post_date', DATE_ADD('$post_date', INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE), '$content', '$title', 'publish', '$comment_status', '$ping_status', '$post_name')"); 105 $post_id = $wpdb->get_var("SELECT ID FROM $ tableposts WHERE post_title = '$title' AND post_date = '$post_date'");105 $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$title' AND post_date = '$post_date'"); 106 106 if (!$post_id) die("couldn't get post ID"); 107 $exists = $wpdb->get_row("SELECT * FROM $ tablepost2cat WHERE post_id = $post_id AND category_id = 1");108 if (!$exists) $wpdb->query("INSERT INTO $ tablepost2cat (post_id, category_id) VALUES ($post_id, 1) ");107 $exists = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post_id AND category_id = 1"); 108 if (!$exists) $wpdb->query("INSERT INTO $wpdb->post2cat (post_id, category_id) VALUES ($post_id, 1) "); 109 109 echo 'Done!</li>'; 110 110 endif;
Note: See TracChangeset
for help on using the changeset viewer.