Changeset 1002
- Timestamp:
- 03/25/2004 02:37:47 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r1001 r1002 102 102 $add_seconds_blog = get_settings('gmt_offset') * 3600; 103 103 $add_seconds_server = date('Z'); 104 $now = gmdate('Y-m-d H:i:s');104 $now = current_time('mysql'); 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"); 109 break; 110 case 'blog': 108 111 $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE post_date <= '$now' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1"); 109 112 break; 110 case 'blog':111 $lastpostdate = $wpdb->get_var("SELECT DATE_ADD(post_date, INTERVAL '$add_seconds_blog' SECOND) FROM $tableposts WHERE post_date <= '$now' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1");112 break;113 113 case 'server': 114 $lastpostdate = $wpdb->get_var("SELECT DATE_ADD(post_date , INTERVAL '$add_seconds_server' SECOND) FROM $tableposts WHERE post_date <= '$now' AND post_status = 'publish' ORDER BY post_dateDESC LIMIT 1");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"); 115 115 break; 116 116 } … … 130 130 switch($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_modified DESC LIMIT 1"); 133 break; 134 case 'blog': 132 135 $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $tableposts WHERE post_modified <= '$now' AND post_status = 'publish' ORDER BY post_modified DESC LIMIT 1"); 133 136 break; 134 case 'blog':135 $lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified, INTERVAL '$add_seconds_blog' SECOND) FROM $tableposts WHERE post_modified <= '$now' AND post_status = 'publish' ORDER BY post_modified DESC LIMIT 1");136 break;137 137 case 'server': 138 $lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified , INTERVAL '$add_seconds_server' SECOND) FROM $tableposts WHERE post_modified <= '$now' AND post_status = 'publish' ORDER BY post_modifiedDESC LIMIT 1");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"); 139 139 break; 140 140 }
Note: See TracChangeset
for help on using the changeset viewer.