Show
Ignore:
Timestamp:
08/12/05 07:03:13 (3 years ago)
Author:
matt
Message:

Fixes #1575

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.5/wp-includes/comment-functions.php

    r2575 r2777  
    356356 
    357357function get_lastcommentmodified($timezone = 'server') { 
    358     global $tablecomments, $cache_lastcommentmodified, $pagenow, $wpdb; 
     358    global $cache_lastcommentmodified, $pagenow, $wpdb; 
    359359    $add_seconds_blog = get_settings('gmt_offset') * 3600; 
    360360    $add_seconds_server = date('Z'); 
     
    363363        switch(strtolower($timezone)) { 
    364364            case 'gmt': 
    365                 $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); 
     365                $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); 
    366366                break; 
    367367            case 'blog': 
    368                 $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); 
     368                $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); 
    369369                break; 
    370370            case 'server': 
    371                 $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"); 
     371                $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"); 
    372372                break; 
    373373        }