From 0d1aebb795dc91381a1fa4f8e860b7d8a39a682a Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 17 May 2004 04:40:23 +0000 Subject: [PATCH] Import date fixes from 2fargon. git-svn-id: https://develop.svn.wordpress.org/trunk@1292 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/import-mt.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/import-mt.php b/wp-admin/import-mt.php index d466ab73e1..fbfccf7334 100644 --- a/wp-admin/import-mt.php +++ b/wp-admin/import-mt.php @@ -263,6 +263,7 @@ foreach ($posts as $post) { if ('' != trim($post)) { case 'DATE': $post_date = strtotime($value); $post_date = date('Y-m-d H:i:s', $post_date); + $post_date_gmt = get_gmt_from_date("$post_date"); break; default: // echo "\n$key: $value"; @@ -276,9 +277,9 @@ foreach ($posts as $post) { if ('' != trim($post)) { } else { $post_author = checkauthor($post_author);//just so that if a post already exists, new users are not created by checkauthor $wpdb->query("INSERT INTO $tableposts ( - post_author, post_date, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_name) + post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_name, post_modified, post_modified_gmt) VALUES - ('$post_author', '$post_date', '$post_content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_name')"); + ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_name','$post_date', '$post_date_gmt')"); $post_id = $wpdb->get_var("SELECT ID FROM $tableposts WHERE post_title = '$post_title' AND post_date = '$post_date'"); if (0 != count($post_categories)) { foreach ($post_categories as $post_category) {