Changeset 569

Show
Ignore:
Timestamp:
12/05/03 01:24:02 (5 years ago)
Author:
mikelittle
Message:

Removed $querycount. Added $wpdb->querycount

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/b2.php

    r144 r569  
    4949<?php 
    5050if ($debug=="1") { 
    51     echo "<p>$querycount queries - ".number_format(timer_stop(),3)." seconds</p>"; 
     51    echo "<p>$wpdb->querycount queries - ".number_format(timer_stop(),3)." seconds</p>"; 
    5252} 
    5353?> 
  • trunk/b2comments.php

    r559 r569  
    1616 
    1717        $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date"); 
    18         ++$querycount; 
    1918?> 
    2019 
  • trunk/b2comments.post.php

    r558 r569  
    4040 
    4141$commentstatus = $wpdb->get_var("SELECT comment_status FROM $tableposts WHERE ID = $comment_post_ID"); 
    42 ++$querycount; 
    4342if ('closed' == $commentstatus) 
    4443    die('Sorry, comments are closed for this item.'); 
     
    6968/* Flood-protection */ 
    7069$lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1"); 
    71 ++$querycount; 
    7270$ok = true; 
    7371if (!empty($lasttime)) { 
     
    102100 
    103101    $comment_ID = $wpdb->get_var('SELECT last_insert_id()'); 
    104     ++$querycount; 
    105102 
    106103    if (($moderation_notify) && (!$approved)) { 
  • trunk/b2commentspopup.php

    r558 r569  
    3131// this line is WordPress' motor, do not delete it. 
    3232$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date"); 
    33 ++$querycount; 
    3433$commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $tableposts WHERE ID = $id"); 
    35 ++$querycount; 
    3634if (!empty($commentstatus->post_password) && $HTTP_COOKIE_VARS['wp-postpass_'.$cookiehash] != $commentstatus->post_password) {  // and it doesn't match the cookie 
    3735    echo(get_the_password_form()); 
  • trunk/b2login.php

    r558 r569  
    8787            $password = substr($password, 4, strlen($password)); 
    8888            $query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND MD5(user_pass) = '$password'"; 
    89             ++$querycount; 
    9089        } else { 
    9190            $pass_is_md5 = 0; 
    9291            $query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND user_pass = '$password'"; 
    93             ++$querycount; 
    9492        } 
    9593        $login = $wpdb->get_row($query); 
  • trunk/b2mail.php

    r558 r569  
    205205        $sql = "SELECT ID, user_level FROM $tableusers WHERE user_login='$user_login' AND user_pass='$user_pass' ORDER BY ID DESC LIMIT 1"; 
    206206        $result = $wpdb->get_row($sql); 
    207         ++$querycount; 
    208207 
    209208        if (!$result) { 
  • trunk/b2register.php

    r558 r569  
    8181    /* checking the login isn't already used by another user */ 
    8282    $result = $wpdb->get_results("SELECT user_login FROM $tableusers WHERE user_login = '$user_login'"); 
    83     ++$querycount; 
    8483    if (count($result) >= 1) { 
    8584        die ('<strong>ERROR</strong>: This login is already registered, please choose another one.'); 
  • trunk/b2trackback.php

    r558 r569  
    3232 
    3333    $pingstatus = $wpdb->get_var("SELECT ping_status FROM $tableposts WHERE ID = $tb_id"); 
    34     ++$querycount; 
    3534 
    3635    if ('closed' == $pingstatus) 
     
    8887    } else { 
    8988        $comment_ID = $wpdb->get_var('SELECT last_insert_id()'); 
    90         ++$querycount; 
    9189        if ($comments_notify) 
    9290            wp_notify_postauthor($comment_ID, 'trackback'); 
  • trunk/blog.header.php

    r559 r569  
    308308// echo $request; 
    309309$posts = $wpdb->get_results($request); 
    310 ++$querycount; 
    311310if (1 == count($posts)) { 
    312311    if ($p || $name) { 
  • trunk/index.php

    r565 r569  
    115115</div> 
    116116 
    117 <p class="credit"><?php timer_stop(1); ?> <cite>Powered by <a href="http://wordpress.org"><strong>WordPress</strong></a></cite></p> 
     117<p class="credit"><?php echo $wpdb->querycount; ?> queries. <?php timer_stop(1); ?> <cite>Powered by <a href="http://wordpress.org"><strong>WordPress</strong></a></cite></p> 
    118118</body> 
    119119</html> 
  • trunk/wp-commentsrss2.php

    r558 r569  
    6060                                            ORDER BY comment_date  
    6161                                            LIMIT $posts_per_rss"); 
    62             ++$querycount; 
    6362        } 
    6463        else { // if no post id passed in, we'll just ue the last 10 comments. 
     
    8079                                            ORDER BY comment_date DESC 
    8180                                            LIMIT $posts_per_rss"); 
    82             ++$querycount; 
    8381        } 
    8482    // this line is WordPress' motor, do not delete it.