Make WordPress Core


Ignore:
Timestamp:
05/24/2004 08:22:18 AM (21 years ago)
Author:
saxmatt
Message:

Giant commit, sorry mailing list people. Move all table names to new $wpdb versions. Works but the whole app needs thorough testing now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-comments-post.php

    r1237 r1355  
    3333$user_ip = $_SERVER['REMOTE_ADDR'];
    3434
    35 if ( 'closed' ==  $wpdb->get_var("SELECT comment_status FROM $tableposts WHERE ID = '$comment_post_ID'") )
     35if ( 'closed' ==  $wpdb->get_var("SELECT comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'") )
    3636    die( __('Sorry, comments are closed for this item.') );
    3737
     
    5252
    5353// Simple flood-protection
    54 $lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1");
     54$lasttime = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1");
    5555if (!empty($lasttime)) {
    5656    $time_lastcomment= mysql2date('U', $lasttime);
     
    6969}
    7070
    71 $wpdb->query("INSERT INTO $tablecomments
     71$wpdb->query("INSERT INTO $wpdb->comments
    7272(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved)
    7373VALUES
Note: See TracChangeset for help on using the changeset viewer.