Changeset 1000 for trunk/wp-blog-header.php
- Timestamp:
- 03/25/2004 02:15:36 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-blog-header.php
r992 r1000 117 117 $add_hours = intval($time_difference); 118 118 $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)"; 120 120 121 121 // if a month is specified in the querystring, load that month 122 122 if ($m != '') { 123 123 $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); 125 125 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); 127 127 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); 129 129 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); 131 131 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); 133 133 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); 135 135 136 136 } … … 138 138 if ($year != '') { 139 139 $year = '' . intval($year); 140 $where .= " AND YEAR( $wp_posts_post_date_field)='$year'";140 $where .= " AND YEAR(post_date)='$year'"; 141 141 } 142 142 143 143 if ($monthnum != '') { 144 144 $monthnum = '' . intval($monthnum); 145 $where .= " AND MONTH( $wp_posts_post_date_field)='$monthnum'";145 $where .= " AND MONTH(post_date)='$monthnum'"; 146 146 } 147 147 148 148 if ($day != '') { 149 149 $day = '' . intval($day); 150 $where .= " AND DAYOFMONTH( $wp_posts_post_date_field)='$day'";150 $where .= " AND DAYOFMONTH(post_date)='$day'"; 151 151 } 152 152 … … 158 158 if ($w != '') { 159 159 $w = ''.intval($w); 160 $where .= " AND WEEK( $wp_posts_post_date_field, 1)='$w'";160 $where .= " AND WEEK(post_date, 1)='$w'"; 161 161 } 162 162 … … 338 338 $lastpostdate = mysql2date('U',$lastpostdate); 339 339 $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'"; 341 341 } 342 342 } … … 357 357 $startdate = date('Y-m-d H:i:s', ($lastpostdate - (($poststart -1) * 86400))); 358 358 $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'"; 360 360 } 361 361 } else { … … 388 388 } 389 389 390 $now = gmdate('Y-m-d H:i: 00');390 $now = gmdate('Y-m-d H:i:59', time() + ($time_difference * 3600)); 391 391 392 392 if ($pagenow != 'post.php' && $pagenow != 'edit.php') {
Note: See TracChangeset
for help on using the changeset viewer.