Import date fixes from 2fargon.
git-svn-id: https://develop.svn.wordpress.org/trunk@1292 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
306ed77c67
commit
0d1aebb795
|
@ -263,6 +263,7 @@ foreach ($posts as $post) { if ('' != trim($post)) {
|
||||||
case 'DATE':
|
case 'DATE':
|
||||||
$post_date = strtotime($value);
|
$post_date = strtotime($value);
|
||||||
$post_date = date('Y-m-d H:i:s', $post_date);
|
$post_date = date('Y-m-d H:i:s', $post_date);
|
||||||
|
$post_date_gmt = get_gmt_from_date("$post_date");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// echo "\n$key: $value";
|
// echo "\n$key: $value";
|
||||||
|
@ -276,9 +277,9 @@ foreach ($posts as $post) { if ('' != trim($post)) {
|
||||||
} else {
|
} else {
|
||||||
$post_author = checkauthor($post_author);//just so that if a post already exists, new users are not created by checkauthor
|
$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 (
|
$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
|
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'");
|
$post_id = $wpdb->get_var("SELECT ID FROM $tableposts WHERE post_title = '$post_title' AND post_date = '$post_date'");
|
||||||
if (0 != count($post_categories)) {
|
if (0 != count($post_categories)) {
|
||||||
foreach ($post_categories as $post_category) {
|
foreach ($post_categories as $post_category) {
|
||||||
|
|
Loading…
Reference in New Issue