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-includes/template-functions-comment.php

    r1255 r1355  
    2727
    2828function comments_number($zero='No Comments', $one='1 Comment', $more='% Comments', $number='') {
    29     global $id, $comment, $tablecomments, $wpdb, $comment_count_cache;
    30     if ('' == $comment_count_cache["$id"]) $number = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1'");
     29    global $id, $comment, $wpdb, $comment_count_cache;
     30    if ('' == $comment_count_cache["$id"]) $number = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1'");
    3131    else $number = $comment_count_cache["$id"];
    3232    if ($number == 0) {
     
    5757
    5858function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
    59     global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb, $tablecomments, $cookiehash;
     59    global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb, $cookiehash;
    6060    global $querystring_start, $querystring_equal, $querystring_separator;
    6161    global $comment_count_cache, $single;
    6262    if (!$single) {
    6363    if ('' == $comment_count_cache["$id"]) {
    64         $number = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1';");
     64        $number = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1';");
    6565    } else {
    6666        $number = $comment_count_cache["$id"];
Note: See TracChangeset for help on using the changeset viewer.