Changeset 914
- Timestamp:
- 02/23/04 03:42:40 (5 years ago)
- Files:
-
- trunk/wp-admin/post.php (modified) (2 diffs)
- trunk/wp-admin/upgrade-functions.php (modified) (3 diffs)
- trunk/wp-comments-post.php (modified) (1 diff)
- trunk/wp-includes/functions.php (modified) (3 diffs)
- trunk/wp-mail.php (modified) (1 diff)
- trunk/wp-register.php (modified) (1 diff)
- trunk/wp-trackback.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/post.php
r912 r914 84 84 $mn = ($mn > 59) ? $mn - 60 : $mn; 85 85 $ss = ($ss > 59) ? $ss - 60 : $ss; 86 $now = "$aa-$mm-$jj $hh:$mn:$ss"; 87 // for GMT dates: compute GMT time from user's timezone time with time_difference 86 $now = get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss") 88 87 } else { 89 $now = current_time('mysql'); 90 // for GMT dates: $now = gmdate('Y-m-d H:i:s'); 88 $now = gmdate('Y-m-d H:i:s'); 91 89 } 92 90 … … 311 309 $mn = ($mn > 59) ? $mn - 60 : $mn; 312 310 $ss = ($ss > 59) ? $ss - 60 : $ss; 313 $datemodif = ", post_date=\"$aa-$mm-$jj $hh:$mn:$ss\""; 314 /* for GMT dates: 315 $add_hours = intval($time_difference); 316 $add_minutes = intval(60 * ($time_difference - $add_hours)); 317 $datemodif = ", post_date = DATE_ADD('$aa-$mm-$jj $hh:$mn:$ss', INTERVAL '-$add_hours:$add_minutes' HOUR_MINUTE)"; 318 */ 311 $datemodif = ", post_date = '".get_gmt_from_date('$aa-$mm-$jj $hh:$mn:$ss')."'"; 319 312 } else { 320 313 $datemodif = ''; 321 314 } 322 $now = current_time('mysql');323 // for GMT dates:$now = gmdate('Y-m-d H:i:s');315 316 $now = gmdate('Y-m-d H:i:s'); 324 317 325 318 $result = $wpdb->query(" trunk/wp-admin/upgrade-functions.php
r911 r914 713 713 } 714 714 715 / * for GMT dates: this is commented until all of WP can deal with GMT715 // Convert all datetime fields' values to GMT, and update $time_difference 716 716 $time_difference = get_settings('time_difference'); 717 717 … … 731 731 $add_hours = intval($diff_gmt_weblogger); 732 732 $add_minutes = intval(60 * ($diff_gmt_weblogger - $add_hours)); 733 734 #field names to update:735 #wp_posts.post_date736 #wp_posts.post_modified737 #wp_comments.comment_date738 #wp_users.dateYMDhour739 733 740 734 #the queries are simple … … 754 748 755 749 } 756 */757 750 758 751 } trunk/wp-comments-post.php
r860 r914 48 48 49 49 50 $now = current_time('mysql'); 50 $now = gmdate('Y-m-d H:i:s'); 51 51 52 52 53 $comment = balanceTags($comment, 1); trunk/wp-includes/functions.php
r908 r914 97 97 98 98 function get_lastpostdate() { 99 global $tableposts, $cache_lastpostdate, $use_cache, $ time_difference, $pagenow, $wpdb;99 global $tableposts, $cache_lastpostdate, $use_cache, $pagenow, $wpdb; 100 100 if ((!isset($cache_lastpostdate)) OR (!$use_cache)) { 101 $now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600))); 102 101 $now = gmdate('Y-m-d H:i:s'); 103 102 $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE post_date <= '$now' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1"); 104 103 $cache_lastpostdate = $lastpostdate; … … 112 111 global $tableposts, $cache_lastpostmodified, $use_cache, $pagenow, $wpdb; 113 112 if ((!isset($cache_lastpostmodified)) OR (!$use_cache)) { 114 $time_difference = get_settings('time_difference'); // for some weird reason the global wasn't set anymore? 115 $now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600))); 116 113 $now = gmdate('Y-m-d H:i:s'); 117 114 $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $tableposts WHERE post_modified <= '$now' AND post_status = 'publish' ORDER BY post_modified DESC LIMIT 1"); 118 115 $cache_lastpostmodified = $lastpostmodified; … … 1486 1483 if (!isset($r['order'])) $r['order'] = ''; 1487 1484 1488 $now = current_time('mysql');1485 $now = gmdate('Y-m-d H:i:s'); 1489 1486 1490 1487 $posts = $wpdb->get_results("SELECT DISTINCT * FROM $tableposts WHERE post_date <= '$now' AND (post_status = 'publish') GROUP BY $tableposts.ID ORDER BY post_date DESC LIMIT " . $r['offset'] . ',' . $r['numberposts']); trunk/wp-mail.php
r907 r914 107 107 } 108 108 $ddate_U = mktime($ddate_H, $ddate_i, $ddate_s, $ddate_m, $ddate_d, $ddate_Y); 109 $ddate_U = $ddate_U + ($time_difference * 3600); 110 $post_date = date('Y-m-d H:i:s', $ddate_U);109 110 $post_date = gmdate('Y-m-d H:i:s', $ddate_U); 111 111 } 112 112 } trunk/wp-register.php
r880 r914 88 88 $pass1 = addslashes($pass1); 89 89 $user_nickname = addslashes($user_nickname); 90 $now = current_time('mysql');90 $now = gmdate('Y-m-d H:i:s'); 91 91 92 92 $result = $wpdb->query("INSERT INTO $tableusers trunk/wp-trackback.php
r836 r914 53 53 $user_domain = gethostbyaddr($user_ip); 54 54 $time_difference = get_settings('time_difference'); 55 $now = current_time('mysql');55 $now = gmdate('Y-m-d H:i:s'); 56 56 57 57 $comment = convert_chars($comment);
