203 | | $now = current_time('mysql', 1); |
204 | | if ( !isset($cache_lastcommentmodified[$timezone]) ) { |
205 | | switch ( strtolower($timezone)) { |
206 | | case 'gmt': |
207 | | $lastcommentmodified = $wpdb->get_var($wpdb->prepare("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_date_gmt <= %s AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1", $now)); |
208 | | break; |
209 | | case 'blog': |
210 | | $lastcommentmodified = $wpdb->get_var($wpdb->prepare("SELECT comment_date FROM $wpdb->comments WHERE comment_date_gmt <= %s AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1", $now)); |
211 | | break; |
212 | | case 'server': |
213 | | $lastcommentmodified = $wpdb->get_var($wpdb->prepare("SELECT DATE_ADD(comment_date_gmt, INTERVAL %s SECOND) FROM $wpdb->comments WHERE comment_date_gmt <= %s AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1", $add_seconds_server, $now)); |
214 | | break; |
215 | | } |
216 | | $cache_lastcommentmodified[$timezone] = $lastcommentmodified; |
217 | | } else { |
218 | | $lastcommentmodified = $cache_lastcommentmodified[$timezone]; |
| 207 | |
| 208 | switch ( strtolower($timezone)) { |
| 209 | case 'gmt': |
| 210 | $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1"); |
| 211 | break; |
| 212 | case 'blog': |
| 213 | $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1"); |
| 214 | break; |
| 215 | case 'server': |
| 216 | $lastcommentmodified = $wpdb->get_var($wpdb->prepare("SELECT DATE_ADD(comment_date_gmt, INTERVAL %s SECOND) FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1", $add_seconds_server)); |
| 217 | break; |