Make WordPress Core


Ignore:
Timestamp:
11/25/2003 12:46:52 AM (22 years ago)
Author:
mikelittle
Message:

Missing querycount

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/b2-include/b2functions.php

    r555 r558  
    479479// determine the post ID it represents.
    480480function url_to_postid($url = '') {
    481     global $wpdb, $tableposts, $siteurl;
     481    global $wpdb, $querycount, $tableposts, $siteurl;
    482482
    483483    // Take a link like 'http://example.com/blog/something'
     
    537537
    538538    // Run the query to get the post ID:
    539     return intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where));
     539    ++$querycount;
     540    return intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where));
    540541}
    541542
     
    682683        $default = $postdata["Category"];
    683684    }
     685    ++$querycount;
    684686    foreach($results as $post) {
    685687        echo "<option value=\"".$post->cat_ID."\"";
     
    14401442 */
    14411443function wp_get_comment_status($comment_id) {
    1442     global $wpdb, $tablecomments;
     1444    global $wpdb, $querycount, $tablecomments;
    14431445   
    14441446    $result = $wpdb->get_var("SELECT comment_approved FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
     1447    ++$querycount;
    14451448    if ($result == NULL) {
    1446     return "deleted";
     1449        return "deleted";
    14471450    } else if ($result == "1") {
    1448     return "approved";
     1451        return "approved";
    14491452    } else if ($result == "0") {
    1450     return "unapproved";
     1453        return "unapproved";
    14511454    } else {
    1452     return false;
     1455        return false;
    14531456    }
    14541457}
    14551458
    14561459function wp_notify_postauthor($comment_id, $comment_type) {
    1457     global $wpdb, $tablecomments, $tableposts, $tableusers;
     1460    global $wpdb, $querycount, $tablecomments, $tableposts, $tableusers;
    14581461    global $querystring_start, $querystring_equal, $querystring_separator;
    14591462    global $blogfilename, $blogname, $siteurl;
    14601463   
    14611464    $comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
     1465    ++$querycount;
    14621466    $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1");
     1467    ++$querycount;
    14631468    $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID='$post->post_author' LIMIT 1");
     1469    ++$querycount;
    14641470
    14651471    if ('' == $user->user_email) return false; // If there's no email to send the comment to
     
    15121518 */
    15131519function wp_notify_moderator($comment_id) {
    1514     global $wpdb, $tablecomments, $tableposts, $tableusers;
     1520    global $wpdb, $querycount, $tablecomments, $tableposts, $tableusers;
    15151521    global $querystring_start, $querystring_equal, $querystring_separator;
    15161522    global $blogfilename, $blogname, $siteurl;
    15171523   
    15181524    $comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
     1525    ++$querycount;
    15191526    $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1");
     1527    ++$querycount;
    15201528    $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID='$post->post_author' LIMIT 1");
     1529    ++$querycount;
    15211530
    15221531    $comment_author_domain = gethostbyaddr($comment->comment_author_IP);
    15231532    $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $tablecomments WHERE comment_approved = '0'");
     1533    ++$querycount;
    15241534
    15251535    $notify_message  = "A new comment on the post #$comment->comment_post_ID \"".stripslashes($post->post_title)."\" is waiting for your approval\r\n\r\n";
Note: See TracChangeset for help on using the changeset viewer.