Changeset 914

Show
Ignore:
Timestamp:
02/23/04 03:42:40 (5 years ago)
Author:
michelvaldrighi
Message:

big leap to GMT dates

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/post.php

    r912 r914  
    8484            $mn = ($mn > 59) ? $mn - 60 : $mn; 
    8585            $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") 
    8887        } 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'); 
    9189        } 
    9290 
     
    311309            $mn = ($mn > 59) ? $mn - 60 : $mn; 
    312310            $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')."'"; 
    319312        } else { 
    320313            $datemodif = ''; 
    321314        } 
    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'); 
    324317 
    325318        $result = $wpdb->query(" 
  • trunk/wp-admin/upgrade-functions.php

    r911 r914  
    713713    } 
    714714 
    715     /* for GMT dates: this is commented until all of WP can deal with GMT 
     715    // Convert all datetime fields' values to GMT, and update $time_difference 
    716716    $time_difference = get_settings('time_difference'); 
    717717 
     
    731731        $add_hours = intval($diff_gmt_weblogger); 
    732732        $add_minutes = intval(60 * ($diff_gmt_weblogger - $add_hours)); 
    733  
    734         #field names to update: 
    735         #wp_posts.post_date 
    736         #wp_posts.post_modified 
    737         #wp_comments.comment_date 
    738         #wp_users.dateYMDhour 
    739733 
    740734        #the queries are simple 
     
    754748 
    755749    } 
    756     */ 
    757750 
    758751} 
  • trunk/wp-comments-post.php

    r860 r914  
    4848 
    4949 
    50 $now = current_time('mysql'); 
     50$now = gmdate('Y-m-d H:i:s'); 
     51 
    5152 
    5253$comment = balanceTags($comment, 1); 
  • trunk/wp-includes/functions.php

    r908 r914  
    9797 
    9898function get_lastpostdate() { 
    99     global $tableposts, $cache_lastpostdate, $use_cache, $time_difference, $pagenow, $wpdb; 
     99    global $tableposts, $cache_lastpostdate, $use_cache, $pagenow, $wpdb; 
    100100    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'); 
    103102        $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE post_date <= '$now' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1"); 
    104103        $cache_lastpostdate = $lastpostdate; 
     
    112111    global $tableposts, $cache_lastpostmodified, $use_cache, $pagenow, $wpdb; 
    113112    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'); 
    117114        $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $tableposts WHERE post_modified <= '$now' AND post_status = 'publish' ORDER BY post_modified DESC LIMIT 1"); 
    118115        $cache_lastpostmodified = $lastpostmodified; 
     
    14861483    if (!isset($r['order'])) $r['order'] = ''; 
    14871484 
    1488     $now = current_time('mysql'); 
     1485    $now = gmdate('Y-m-d H:i:s'); 
    14891486 
    14901487    $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  
    107107                } 
    108108                $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); 
    111111            } 
    112112        } 
  • trunk/wp-register.php

    r880 r914  
    8888    $pass1 = addslashes($pass1); 
    8989    $user_nickname = addslashes($user_nickname); 
    90     $now = current_time('mysql'); 
     90    $now = gmdate('Y-m-d H:i:s'); 
    9191 
    9292    $result = $wpdb->query("INSERT INTO $tableusers  
  • trunk/wp-trackback.php

    r836 r914  
    5353    $user_domain = gethostbyaddr($user_ip); 
    5454    $time_difference = get_settings('time_difference'); 
    55     $now = current_time('mysql'); 
     55    $now = gmdate('Y-m-d H:i:s'); 
    5656 
    5757    $comment = convert_chars($comment);