$user_id = 4; $table_prepend = "migrate-"; // Getting the content of this entries body $body_str = <<I've made this post so that I can test to see how well a redirect can be made for a post.

Labels: ,

HERE; $body_count = strlen($body_str); // Getting the name of this entries body $name_str = <<.{1,}<\/p>)/', '', $body_str); // Formatting the date properly $BlogItemDateTime = '6/12/2008 09:20:00 AM'; $BlogItemDateTime_ar = explode(' ', $BlogItemDateTime); if($BlogItemDateTime_ar[1] == 'PM') $BlogItemDateTime_ar['hour'][0] += 12; $BlogItemDateTime_ar['day'] = explode('/', $BlogItemDateTime_ar[0]); $BlogItemDateTime_ar['hour'] = explode(':', $BlogItemDateTime_ar[1]); $BlogItemDateTime_ar['mysql'] = $BlogItemDateTime_ar['day'][2].'-'.$BlogItemDateTime_ar['day'][1].'-'.$BlogItemDateTime_ar['day'][0].' '.$BlogItemDateTime_ar['hour'][0].':'.$BlogItemDateTime_ar['hour'][1].':'.$BlogItemDateTime_ar['hour'][2]; $BlogItemDateTime = $BlogItemDateTime_ar['mysql']; // Insert this entry into the migration table $body_str = addslashes($body_str); $DB->query("INSERT INTO `{$table_prepend}evo_items__item` ". "SET `post_creator_user_ID` = '{$user_id}', ". "`post_lastedit_user_ID` = '{$user_id}', ". "`post_datestart` = '{$BlogItemDateTime}', ". "`post_datecreated` = '{$BlogItemDateTime}', ". "`post_datemodified` = '{$BlogItemDateTime}', ". "`post_status` = 'deprecated', ". "`post_ptyp_ID` = '1', ". "`post_locale` = 'en-US', ". "`post_title` = '{$name_str}', ". "`post_urltitle` = '{$url_str}', ". "`post_notifications_status` = 'noreq', ". "`post_comment_status` = 'open', ". "`post_renderers` = 'default', ". "`post_priority` = '3', ". "`post_wordcount` = '{$body_count}', ". "`post_content` = '{$body_str}'"); // Getting the last inserts ID $entry_id = $DB->last_insert(); // Going through each of the new categories and adding the relation ship to the database foreach($categories[1] as $key => $val) { // Checking to see if this one exists yet $test_cat = $DB->query("SELECT `cat_ID` FROM `{$table_prepend}evo_categories` WHERE `cat_name` = '{$val}' LIMIT 1", true); if(!$test_cat['cat_ID']){ // Creating the cat link $url_str = preg_replace( '/([^\w-])/', '', strtolower( str_replace( ' ', '-', $val ) ) ); // If not create it and get its ID $DB->query("INSERT INTO `{$table_prepend}evo_categories` ". "SET `cat_name` = '{$val}', ". " `cat_urlname` = '{$url_str}', ". " `cat_blog_ID` = '1'"); $test_cat['cat_ID'] = $DB->last_insert(); } // Insert this entry/category entry $DB->query("INSERT INTO `{$table_prepend}evo_postcats` ". "SET `postcat_post_ID` = '{$entry_id}', ". " `postcat_cat_ID` = '{$test_cat['cat_ID']}'"); // Updating the primary cat key $DB->query("UPDATE `{$table_prepend}evo_items__item` ". "SET `post_main_cat_ID` = '{$test_cat['cat_ID']}' ". "WHERE `post_ID` = '{$entry_id}'"); } // Getting the content of this comments body $body_str = <<Blogger belleyBoy HERE; // Getting the authors name preg_match('/rel="nofollow">((.){1,})<\/a>/', $author_str, $author_ar); $author_str = addslashes($author_ar[1]); // Formatting the date properly $BlogCommentDateTime = '6/12/08, 4:57 PM'; $BlogCommentDateTime_ar = explode(' ', $BlogCommentDateTime); if($BlogCommentDateTime_ar[1] == 'PM') $BlogCommentDateTime_ar['hour'][0] += 12; $BlogCommentDateTime_ar['day'] = explode('/', $BlogCommentDateTime_ar[0]); $BlogCommentDateTime_ar['hour'] = explode(':', $BlogCommentDateTime_ar[1]); $BlogCommentDateTime_ar['mysql'] = $BlogCommentDateTime_ar['day'][2].'-'.$BlogCommentDateTime_ar['day'][1].'-'.$BlogCommentDateTime_ar['day'][0].' '.$BlogCommentDateTime_ar['hour'][0].':'.$BlogCommentDateTime_ar['hour'][1].':'.$BlogCommentDateTime_ar['hour'][2]; $BlogCommentDateTime = $BlogCommentDateTime_ar['mysql']; // Adding the comment to the database $body_str = addslashes($body_str); $DB->query("INSERT INTO `{$table_prepend}evo_comments` ". "SET `comment_type` = 'comment', ". "`comment_status` = 'published', ". "`comment_nofollow` = '1', ". "`comment_date` = '{$BlogCommentDateTime}', ". "`comment_author` = '{$author_str}', ". "`comment_content` = '{$body_str}', ". "`comment_post_ID` = $entry_id"); // Getting the content of this entries body $body_str = <<I have created this Blog to test out the functionality of Blogger/Blog Spot.
I want to know if I can export the existing Blog entries easily and how I can control redirects.
Lets see how this goes.

Labels:

HERE; $body_count = strlen($body_str); // Getting the name of this entries body $name_str = <<.{1,}<\/p>)/', '', $body_str); // Formatting the date properly $BlogItemDateTime = '6/12/2008 08:31:00 AM'; $BlogItemDateTime_ar = explode(' ', $BlogItemDateTime); if($BlogItemDateTime_ar[1] == 'PM') $BlogItemDateTime_ar['hour'][0] += 12; $BlogItemDateTime_ar['day'] = explode('/', $BlogItemDateTime_ar[0]); $BlogItemDateTime_ar['hour'] = explode(':', $BlogItemDateTime_ar[1]); $BlogItemDateTime_ar['mysql'] = $BlogItemDateTime_ar['day'][2].'-'.$BlogItemDateTime_ar['day'][1].'-'.$BlogItemDateTime_ar['day'][0].' '.$BlogItemDateTime_ar['hour'][0].':'.$BlogItemDateTime_ar['hour'][1].':'.$BlogItemDateTime_ar['hour'][2]; $BlogItemDateTime = $BlogItemDateTime_ar['mysql']; // Insert this entry into the migration table $body_str = addslashes($body_str); $DB->query("INSERT INTO `{$table_prepend}evo_items__item` ". "SET `post_creator_user_ID` = '{$user_id}', ". "`post_lastedit_user_ID` = '{$user_id}', ". "`post_datestart` = '{$BlogItemDateTime}', ". "`post_datecreated` = '{$BlogItemDateTime}', ". "`post_datemodified` = '{$BlogItemDateTime}', ". "`post_status` = 'deprecated', ". "`post_ptyp_ID` = '1', ". "`post_locale` = 'en-US', ". "`post_title` = '{$name_str}', ". "`post_urltitle` = '{$url_str}', ". "`post_notifications_status` = 'noreq', ". "`post_comment_status` = 'open', ". "`post_renderers` = 'default', ". "`post_priority` = '3', ". "`post_wordcount` = '{$body_count}', ". "`post_content` = '{$body_str}'"); // Getting the last inserts ID $entry_id = $DB->last_insert(); // Going through each of the new categories and adding the relation ship to the database foreach($categories[1] as $key => $val) { // Checking to see if this one exists yet $test_cat = $DB->query("SELECT `cat_ID` FROM `{$table_prepend}evo_categories` WHERE `cat_name` = '{$val}' LIMIT 1", true); if(!$test_cat['cat_ID']){ // Creating the cat link $url_str = preg_replace( '/([^\w-])/', '', strtolower( str_replace( ' ', '-', $val ) ) ); // If not create it and get its ID $DB->query("INSERT INTO `{$table_prepend}evo_categories` ". "SET `cat_name` = '{$val}', ". " `cat_urlname` = '{$url_str}', ". " `cat_blog_ID` = '1'"); $test_cat['cat_ID'] = $DB->last_insert(); } // Insert this entry/category entry $DB->query("INSERT INTO `{$table_prepend}evo_postcats` ". "SET `postcat_post_ID` = '{$entry_id}', ". " `postcat_cat_ID` = '{$test_cat['cat_ID']}'"); // Updating the primary cat key $DB->query("UPDATE `{$table_prepend}evo_items__item` ". "SET `post_main_cat_ID` = '{$test_cat['cat_ID']}' ". "WHERE `post_ID` = '{$entry_id}'"); }