From d8cb7841fb839d017f5e8d888f1e763499b2d7ff Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 10 Mar 2005 09:50:26 +0000 Subject: [PATCH] Fix timestamp editing. http://mosquito.wordpress.org/view.php?id=1022 git-svn-id: https://develop.svn.wordpress.org/trunk@2429 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-functions.php | 24 ++++++++++++++++++------ wp-admin/edit-form-comment.php | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 5332eb3078..720997e33a 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -409,10 +409,9 @@ function update_meta($mid, $mkey, $mvalue) { return $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '$mkey', meta_value = '$mvalue' WHERE meta_id = '$mid'"); } -function touch_time($edit = 1) { - global $month, $postdata; - // echo $postdata['Date']; - if ('draft' == $postdata->post_status) { +function touch_time($edit = 1, $for_post = 1) { + global $month, $postdata, $commentdata; + if ( $for_post && ('draft' == $postdata->post_status) ) { $checked = 'checked="checked" '; $edit = false; } else { @@ -422,7 +421,7 @@ function touch_time($edit = 1) { echo '
'; $time_adj = time() + (get_settings('gmt_offset') * 3600); - $post_date = $postdata->post_date; + $post_date = ($for_post) ? $postdata->post_date : $commentdata['comment_date']; $jj = ($edit) ? mysql2date('d', $post_date) : gmdate('d', $time_adj); $mm = ($edit) ? mysql2date('m', $post_date) : gmdate('m', $time_adj); $aa = ($edit) ? mysql2date('Y', $post_date) : gmdate('Y', $time_adj); @@ -449,7 +448,20 @@ function touch_time($edit = 1) { @ : - :
+ +: + post_status) ) { + $jj = mysql2date('d', $post_date); + $mm = mysql2date('m', $post_date); + $aa = mysql2date('Y', $post_date); + $hh = mysql2date('H', $post_date); + $mn = mysql2date('i', $post_date); + $ss = mysql2date('s', $post_date); + } + echo "{$month[$mm]} $jj, $aa @ $hh:$mn"; ?> + 4) : ?> : - +