Make WordPress Core


Ignore:
Timestamp:
01/16/2006 08:03:56 PM (20 years ago)
Author:
ryan
Message:

Use ->comments instead of . fixes #2294

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-functions.php

    r3427 r3442  
    544544
    545545function get_lastcommentmodified($timezone = 'server') {
    546     global $tablecomments, $cache_lastcommentmodified, $pagenow, $wpdb;
     546    global $cache_lastcommentmodified, $pagenow, $wpdb;
    547547    $add_seconds_blog = get_settings('gmt_offset') * 3600;
    548548    $add_seconds_server = date('Z');
     
    551551        switch(strtolower($timezone)) {
    552552            case 'gmt':
    553                 $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1");
     553                $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1");
    554554                break;
    555555            case 'blog':
    556                 $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1");
     556                $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1");
    557557                break;
    558558            case 'server':
    559                 $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");
     559                $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");
    560560                break;
    561561        }
Note: See TracChangeset for help on using the changeset viewer.