now posts and edits in localtime+gmt
git-svn-id: https://develop.svn.wordpress.org/trunk@995 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9d5f0af661
commit
0f794be3e6
|
@ -97,9 +97,11 @@ switch($action) {
|
||||||
$hh = ($hh > 23) ? $hh - 24 : $hh;
|
$hh = ($hh > 23) ? $hh - 24 : $hh;
|
||||||
$mn = ($mn > 59) ? $mn - 60 : $mn;
|
$mn = ($mn > 59) ? $mn - 60 : $mn;
|
||||||
$ss = ($ss > 59) ? $ss - 60 : $ss;
|
$ss = ($ss > 59) ? $ss - 60 : $ss;
|
||||||
$now = get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss");
|
$now = date("$aa-$mm-$jj $hh:$mn:$ss");
|
||||||
|
$now_gmt = get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss");
|
||||||
} else {
|
} else {
|
||||||
$now = gmdate('Y-m-d H:i:s');
|
$now = current_time('mysql');
|
||||||
|
$now_gmt = current_time('mysql', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($HTTP_POST_VARS['mode'])) {
|
if (!empty($HTTP_POST_VARS['mode'])) {
|
||||||
|
@ -127,15 +129,15 @@ switch($action) {
|
||||||
|
|
||||||
if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
|
if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
|
||||||
$postquery ="INSERT INTO $tableposts
|
$postquery ="INSERT INTO $tableposts
|
||||||
(ID, post_author, post_date, post_content, post_title, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping)
|
(ID, post_author, post_date, post_date_gmt, post_content, post_title, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping)
|
||||||
VALUES
|
VALUES
|
||||||
('0', '$user_ID', '$now', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback')
|
('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback')
|
||||||
";
|
";
|
||||||
} else {
|
} else {
|
||||||
$postquery ="INSERT INTO $tableposts
|
$postquery ="INSERT INTO $tableposts
|
||||||
(ID, post_author, post_date, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping)
|
(ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping)
|
||||||
VALUES
|
VALUES
|
||||||
('0', '$user_ID', '$now', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback')
|
('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback')
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
$postquery =
|
$postquery =
|
||||||
|
@ -322,12 +324,15 @@ switch($action) {
|
||||||
$hh = ($hh > 23) ? $hh - 24 : $hh;
|
$hh = ($hh > 23) ? $hh - 24 : $hh;
|
||||||
$mn = ($mn > 59) ? $mn - 60 : $mn;
|
$mn = ($mn > 59) ? $mn - 60 : $mn;
|
||||||
$ss = ($ss > 59) ? $ss - 60 : $ss;
|
$ss = ($ss > 59) ? $ss - 60 : $ss;
|
||||||
$datemodif = ", post_date = '".get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss")."'";
|
$datemodif = ", post_date = '$aa-$mm-$jj $hh:$mn:$ss'";
|
||||||
|
$datemodif_gmt = ", post_date = '".get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss")."'";
|
||||||
} else {
|
} else {
|
||||||
$datemodif = '';
|
$datemodif = '';
|
||||||
|
$datemodif_gmt = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$now = gmdate('Y-m-d H:i:s');
|
$now = current_time('mysql');
|
||||||
|
$now_gmt = current_time('mysql', 1);
|
||||||
|
|
||||||
$result = $wpdb->query("
|
$result = $wpdb->query("
|
||||||
UPDATE $tableposts SET
|
UPDATE $tableposts SET
|
||||||
|
@ -343,6 +348,7 @@ switch($action) {
|
||||||
post_name = '$post_name',
|
post_name = '$post_name',
|
||||||
to_ping = '$trackback',
|
to_ping = '$trackback',
|
||||||
post_modified = '$now'
|
post_modified = '$now'
|
||||||
|
post_modified_gmt = '$now_gmt'
|
||||||
WHERE ID = $post_ID ");
|
WHERE ID = $post_ID ");
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue