Make WordPress Core


Ignore:
Timestamp:
03/25/2004 02:15:36 AM (21 years ago)
Author:
michelvaldrighi
Message:

back to localtime, also using :59 instead of :00 should be better and still make use of mysql's query cache

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-blog-header.php

    r992 r1000  
    117117$add_hours = intval($time_difference);
    118118$add_minutes = intval(60 * ($time_difference - $add_hours));
    119 $wp_posts_post_date_field = "DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)";
     119$wp_posts_post_date_field = "post_date"; // "DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)";
    120120
    121121// if a month is specified in the querystring, load that month
    122122if ($m != '') {
    123123    $m = ''.intval($m);
    124     $where .= " AND YEAR($wp_posts_post_date_field)=".substr($m,0,4);
     124    $where .= ' AND YEAR(post_date)='.substr($m,0,4);
    125125    if (strlen($m)>5)
    126         $where .= " AND MONTH($wp_posts_post_date_field)=".substr($m,4,2);
     126        $where .= ' AND MONTH(post_date)='.substr($m,4,2);
    127127    if (strlen($m)>7)
    128         $where .= " AND DAYOFMONTH($wp_posts_post_date_field)=".substr($m,6,2);
     128        $where .= ' AND DAYOFMONTH(post_date)='.substr($m,6,2);
    129129    if (strlen($m)>9)
    130         $where .= " AND HOUR($wp_posts_post_date_field.)=".substr($m,8,2);
     130        $where .= ' AND HOUR(post_date.)='.substr($m,8,2);
    131131    if (strlen($m)>11)
    132         $where .= " AND MINUTE($wp_posts_post_date_field)=".substr($m,10,2);
     132        $where .= ' AND MINUTE(post_date)='.substr($m,10,2);
    133133    if (strlen($m)>13)
    134         $where .= " AND SECOND($wp_posts_post_date_field)=".substr($m,12,2);
     134        $where .= ' AND SECOND(post_date)='.substr($m,12,2);
    135135
    136136}
     
    138138if ($year != '') {
    139139    $year = '' . intval($year);
    140     $where .= " AND YEAR($wp_posts_post_date_field)='$year'";
     140    $where .= " AND YEAR(post_date)='$year'";
    141141}
    142142
    143143if ($monthnum != '') {
    144144    $monthnum = '' . intval($monthnum);
    145     $where .= " AND MONTH($wp_posts_post_date_field)='$monthnum'";
     145    $where .= " AND MONTH(post_date)='$monthnum'";
    146146}
    147147
    148148if ($day != '') {
    149149    $day = '' . intval($day);
    150     $where .= " AND DAYOFMONTH($wp_posts_post_date_field)='$day'";
     150    $where .= " AND DAYOFMONTH(post_date)='$day'";
    151151}
    152152
     
    158158if ($w != '') {
    159159    $w = ''.intval($w);
    160     $where .= " AND WEEK($wp_posts_post_date_field, 1)='$w'";
     160    $where .= " AND WEEK(post_date, 1)='$w'";
    161161}
    162162
     
    338338        $lastpostdate = mysql2date('U',$lastpostdate);
    339339        $otherdate = date('Y-m-d H:i:s', ($lastpostdate - (($posts_per_page-1) * 86400)));
    340         $where .= " AND $wp_posts_post_date_field > '$otherdate'";
     340        $where .= " AND post_date > '$otherdate'";
    341341    }
    342342}
     
    357357        $startdate = date('Y-m-d H:i:s', ($lastpostdate - (($poststart -1) * 86400)));
    358358        $otherdate = date('Y-m-d H:i:s', ($lastpostdate - (($postend -1) * 86400)));
    359         $where .= " AND $wp_posts_post_date_field > '$otherdate' AND $wp_posts_post_date_field < '$startdate'";
     359        $where .= " AND post_date > '$otherdate' AND post_date < '$startdate'";
    360360    }
    361361} else {
     
    388388}
    389389
    390 $now = gmdate('Y-m-d H:i:00');
     390$now = gmdate('Y-m-d H:i:59', time() + ($time_difference * 3600));
    391391
    392392if ($pagenow != 'post.php' && $pagenow != 'edit.php') {
Note: See TracChangeset for help on using the changeset viewer.