Changeset 1150
- Timestamp:
- 04/24/2004 09:52:24 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r1108 r1150 25 25 $what_to_show = get_settings('what_to_show'); 26 26 $archive_mode = get_settings('archive_mode'); 27 $time_difference = get_settings('time_difference');28 27 $date_format = stripslashes(get_settings('date_format')); 29 28 $time_format = stripslashes(get_settings('time_format')); -
trunk/wp-admin/options-general.php
r1131 r1150 99 99 <th scope="row"><?php _e('Default date format:') ?></th> 100 100 <td><input name="date_format" type="text" id="date_format" size="30" value="<?php echo get_settings('date_format'); ?>" /><br /> 101 <?php _e('Output:') ?> <strong><?php echo date(get_settings('date_format'), current_time('timestamp', true)); ?></strong></td>101 <?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('date_format'), current_time('timestamp')); ?></strong></td> 102 102 </tr> 103 103 <tr> 104 104 <th scope="row"><?php _e('Default time format:') ?></th> 105 105 <td><input name="time_format" type="text" id="time_format" size="30" value="<?php echo get_settings('time_format'); ?>" /><br /> 106 <?php _e('Output:') ?> <strong><?php echo date(get_settings('time_format'), current_time('timestamp', true)); ?></strong></td>106 <?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('time_format'), current_time('timestamp')); ?></strong></td> 107 107 </tr> 108 108 </table> -
trunk/wp-admin/sidebar.php
r1108 r1150 9 9 if ($user_level == 0) 10 10 die ("Cheatin' uh ?"); 11 12 $time_difference = get_settings('time_difference');13 11 14 12 if ('b' == $_GET['a']) { -
trunk/wp-blog-header.php
r1108 r1150 111 111 $what_to_show = get_settings('what_to_show'); 112 112 $archive_mode = get_settings('archive_mode'); 113 $time_difference = get_settings('time_difference');114 113 $use_gzipcompression = get_settings('gzipcompression'); 115 114 … … 130 129 } 131 130 132 $add_hours = intval( $time_difference);133 $add_minutes = intval(60 * ( $time_difference- $add_hours));131 $add_hours = intval(get_settings('gmt_offset')); 132 $add_minutes = intval(60 * (get_settings('gmt_offset') - $add_hours)); 134 133 $wp_posts_post_date_field = "post_date"; // "DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"; 135 134 -
trunk/wp-commentsrss2.php
r1108 r1150 32 32 LEFT JOIN $tableposts ON comment_post_id = id WHERE comment_post_ID = '$id' 33 33 AND $tablecomments.comment_approved = '1' AND $tableposts.post_status = 'publish' 34 AND post_date < '".date("Y-m-d H:i: s")."'34 AND post_date < '".date("Y-m-d H:i:59")."' 35 35 ORDER BY comment_date LIMIT " . get_settings('posts_per_rss') ); 36 36 } else { // if no post id passed in, we'll just ue the last 10 comments. -
trunk/wp-includes/functions-formatting.php
r1121 r1150 350 350 function get_gmt_from_date($string) { 351 351 // note: this only substracts $time_difference from the given date 352 $time_difference = get_settings('time_difference');353 352 preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); 354 353 $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); 355 $string_gmt = gmdate('Y-m-d H:i:s', $string_time - $time_difference*3600);354 $string_gmt = gmdate('Y-m-d H:i:s', $string_time - get_settings('gmt_offset') * 3600); 356 355 return $string_gmt; 357 356 } … … 360 359 function get_date_from_gmt($string) { 361 360 // note: this only adds $time_difference to the given date 362 $time_difference = get_settings('time_difference');363 361 preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); 364 362 $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); 365 $string_localtime = gmdate('Y-m-d H:i:s', $string_time + $time_difference*3600);363 $string_localtime = gmdate('Y-m-d H:i:s', $string_time + get_settings('gmt_offset')*3600); 366 364 return $string_localtime; 367 365 } -
trunk/wp-includes/functions.php
r1148 r1150 54 54 switch ($type) { 55 55 case 'mysql': 56 return ($gmt) ? gmdate('Y-m-d H:i:s') 57 : gmdate('Y-m-d H:i:s', (time() + ($time_difference * 3600)));; 56 if ($gmt) $d = gmdate('Y-m-d H:i:s'); 57 else $d = gmdate('Y-m-d H:i:s', (time() + (get_settings('gmt_offset') * 3600))); 58 return $d; 58 59 break; 59 60 case 'timestamp': 60 return ($gmt) ? time() 61 : time() + ($time_difference * 3600); 61 if ($gmt) $d = time(); 62 else $d = time() + (get_settings('gmt_offset') * 3600); 63 return $d; 62 64 break; 63 65 } … … 436 438 437 439 function touch_time($edit = 1) { 438 global $month, $postdata , $time_difference;440 global $month, $postdata; 439 441 // echo $postdata['Date']; 440 442 if ('draft' == $postdata['post_status']) { … … 447 449 echo '<p><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" '.$checked.'/> <label for="timestamp">' . __('Edit timestamp') . '</label> <a href="http://wordpress.org/docs/reference/post/#edit_timestamp" title="' . __('Help on changing the timestamp') . '">?</a><br />'; 448 450 449 $time_adj = time() + ( $time_difference* 3600);451 $time_adj = time() + (get_settings('gmt_offset') * 3600); 450 452 $post_date = $postdata['Date']; 451 453 $jj = ($edit) ? mysql2date('d', $post_date) : gmdate('d', $time_adj); -
trunk/wp-includes/links.php
r1053 r1150 187 187 if ($show_updated) { 188 188 if (substr($row->link_updated_f,0,2) != '00') { 189 $title .= ' (Last updated ' . date(get_settings('links_updated_date_format'), $row->link_updated_f + (get_settings(' time_difference') * 3600)) .')';189 $title .= ' (Last updated ' . date(get_settings('links_updated_date_format'), $row->link_updated_f + (get_settings('gmt_offset') * 3600)) .')'; 190 190 } 191 191 } -
trunk/wp-includes/template-functions-general.php
r1142 r1150 220 220 221 221 function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { 222 global $tableposts , $time_difference;222 global $tableposts; 223 223 global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb; 224 224 … … 255 255 } 256 256 257 $add_hours = intval( $time_difference);258 $add_minutes = intval(60 * ( $time_difference- $add_hours));257 $add_hours = intval(get_settings('gmt_offset')); 258 $add_minutes = intval(60 * (get_settings('gmt_offset') - $add_hours)); 259 259 $wp_posts_post_date_field = "post_date"; // "DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"; 260 260 … … 337 337 $w = ''.intval($_GET['w']); 338 338 } 339 $time_difference = get_settings('time_difference'); 340 $add_hours = intval( $time_difference);341 $add_minutes = intval(60 * ( $time_difference- $add_hours));339 340 $add_hours = intval(get_settings('gmt_offset')); 341 $add_minutes = intval(60 * (get_settings('gmt_offset') - $add_hours)); 342 342 $wp_posts_post_date_field = "post_date"; // "DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"; 343 343 … … 360 360 } 361 361 } else { 362 $thisyear = gmdate('Y', current_time('timestamp') + $time_difference* 3600);363 $thismonth = gmdate('m', current_time('timestamp') + $time_difference* 3600);362 $thisyear = gmdate('Y', current_time('timestamp') + get_settings('gmt_offset') * 3600); 363 $thismonth = gmdate('m', current_time('timestamp') + get_settings('gmt_offset') * 3600); 364 364 } 365 365 … … 477 477 $newrow = false; 478 478 479 if ($day == date('j', (time() + ( $time_difference * 3600))) && $thismonth == date('m', time()+($time_difference* 3600)))479 if ($day == date('j', (time() + (get_settings('gmt_offset') * 3600))) && $thismonth == date('m', time()+(get_settings('gmt_offset') * 3600))) 480 480 echo '<td id="today">'; 481 481 else -
trunk/wp-includes/template-functions-links.php
r1112 r1150 88 88 function get_month_link($year, $month) { 89 89 global $querystring_start, $querystring_equal; 90 if (!$year) $year = gmdate('Y', time()+( $time_difference* 3600));91 if (!$month) $month = gmdate('m', time()+( $time_difference* 3600));90 if (!$year) $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600)); 91 if (!$month) $month = gmdate('m', time()+(get_settings('gmt_offset') * 3600)); 92 92 if ('' != get_settings('permalink_structure')) { 93 93 $off = strpos(get_settings('permalink_structure'), '%monthnum%'); … … 106 106 function get_day_link($year, $month, $day) { 107 107 global $querystring_start, $querystring_equal; 108 if (!$year) $year = gmdate('Y', time()+( $time_difference* 3600));109 if (!$month) $month = gmdate('m', time()+( $time_difference* 3600));110 if (!$day) $day = gmdate('j', time()+( $time_difference* 3600));108 if (!$year) $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600)); 109 if (!$month) $month = gmdate('m', time()+(get_settings('gmt_offset') * 3600)); 110 if (!$day) $day = gmdate('j', time()+(get_settings('gmt_offset') * 3600)); 111 111 if ('' != get_settings('permalink_structure')) { 112 112 $off = strpos(get_settings('permalink_structure'), '%day%'); -
trunk/wp-includes/template-functions-post.php
r1142 r1150 316 316 function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { 317 317 global $tableposts, $p, $posts, $id, $post, $wpdb; 318 global $ time_difference, $single;318 global $single; 319 319 global $querystring_start, $querystring_equal, $querystring_separator; 320 320 if(($p) || ($posts==1) || 1 == $single) { -
trunk/wp-mail.php
r1108 r1150 8 8 9 9 $output_debugging_info = 0; # =1 if you want to output debugging info 10 $time_difference = get_settings('time_difference');11 10 12 11 if (get_settings('use_phoneemail')) { -
trunk/wp-trackback.php
r1108 r1150 52 52 $user_ip = $_SERVER['REMOTE_ADDR']; 53 53 $user_domain = gethostbyaddr($user_ip); 54 $time_difference = get_settings('time_difference');55 54 $now = current_time('mysql'); 56 55 $now_gmt = current_time('mysql', 1);
Note: See TracChangeset
for help on using the changeset viewer.