Changeset 1042
- Timestamp:
- 03/31/2004 06:06:45 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r1035 r1042 102 102 $add_seconds_blog = get_settings('gmt_offset') * 3600; 103 103 $add_seconds_server = date('Z'); 104 $now = current_time('mysql' );104 $now = current_time('mysql', 1); 105 105 if ((!isset($cache_lastpostdate[$timezone])) OR (!$use_cache)) { 106 106 switch(strtolower($timezone)) { 107 107 case 'gmt': 108 $lastpostdate = $wpdb->get_var("SELECT post_date_gmt FROM $tableposts WHERE post_date <= '$now' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1");108 $lastpostdate = $wpdb->get_var("SELECT post_date_gmt FROM $tableposts WHERE post_date_gmt <= '$now' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1"); 109 109 break; 110 110 case 'blog': 111 $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE post_date <= '$now' AND post_status = 'publish' ORDER BY post_dateDESC LIMIT 1");111 $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE post_date_gmt <= '$now' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1"); 112 112 break; 113 113 case 'server': 114 $lastpostdate = $wpdb->get_var("SELECT DATE_ADD(post_date_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $tableposts WHERE post_date <= '$now' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1");114 $lastpostdate = $wpdb->get_var("SELECT DATE_ADD(post_date_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $tableposts WHERE post_date_gmt <= '$now' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1"); 115 115 break; 116 116 } … … 126 126 $add_seconds_blog = get_settings('gmt_offset') * 3600; 127 127 $add_seconds_server = date('Z'); 128 $now = gmdate('Y-m-d H:i:s');128 $now = current_time('mysql', 1); 129 129 if ((!isset($cache_lastpostmodified[$timezone])) OR (!$use_cache)) { 130 switch( $timezone) {130 switch(strtolower($timezone)) { 131 131 case 'gmt': 132 $lastpostmodified = $wpdb->get_var("SELECT post_modified_gmt FROM $tableposts WHERE post_modified <= '$now' AND post_status = 'publish' ORDER BY post_modifiedDESC LIMIT 1");132 $lastpostmodified = $wpdb->get_var("SELECT post_modified_gmt FROM $tableposts WHERE post_modified_gmt <= '$now' AND post_status = 'publish' ORDER BY post_modified_gmt DESC LIMIT 1"); 133 133 break; 134 134 case 'blog': 135 $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $tableposts WHERE post_modified <= '$now' AND post_status = 'publish' ORDER BY post_modifiedDESC LIMIT 1");135 $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $tableposts WHERE post_modified_gmt <= '$now' AND post_status = 'publish' ORDER BY post_modified_gmt DESC LIMIT 1"); 136 136 break; 137 137 case 'server': 138 $lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $tableposts WHERE post_modified <= '$now' AND post_status = 'publish' ORDER BY post_modified_gmt DESC LIMIT 1");138 $lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $tableposts WHERE post_modified_gmt <= '$now' AND post_status = 'publish' ORDER BY post_modified_gmt DESC LIMIT 1"); 139 139 break; 140 140 }
Note: See TracChangeset
for help on using the changeset viewer.