Use ->comments instead of . fixes #2294

git-svn-id: http://svn.automattic.com/wordpress/trunk@3442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-01-16 20:03:56 +00:00
parent e701f8c526
commit d96ba966cd
1 changed files with 4 additions and 4 deletions

View File

@ -543,20 +543,20 @@ function pings_open() {
// Non-template functions // Non-template functions
function get_lastcommentmodified($timezone = 'server') { function get_lastcommentmodified($timezone = 'server') {
global $tablecomments, $cache_lastcommentmodified, $pagenow, $wpdb; global $cache_lastcommentmodified, $pagenow, $wpdb;
$add_seconds_blog = get_settings('gmt_offset') * 3600; $add_seconds_blog = get_settings('gmt_offset') * 3600;
$add_seconds_server = date('Z'); $add_seconds_server = date('Z');
$now = current_time('mysql', 1); $now = current_time('mysql', 1);
if ( !isset($cache_lastcommentmodified[$timezone]) ) { if ( !isset($cache_lastcommentmodified[$timezone]) ) {
switch(strtolower($timezone)) { switch(strtolower($timezone)) {
case 'gmt': case 'gmt':
$lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1");
break; break;
case 'blog': case 'blog':
$lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1");
break; break;
case 'server': case 'server':
$lastcommentmodified = $wpdb->get_var("SELECT DATE_ADD(comment_date_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); $lastcommentmodified = $wpdb->get_var("SELECT DATE_ADD(comment_date_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->comments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1");
break; break;
} }
$cache_lastcommentmodified[$timezone] = $lastcommentmodified; $cache_lastcommentmodified[$timezone] = $lastcommentmodified;