diff --git a/b2.php b/b2.php index f0b8de0a88..fb14e28ac8 100644 --- a/b2.php +++ b/b2.php @@ -48,7 +48,7 @@ $querycount queries - ".number_format(timer_stop(),3)." seconds
"; + echo "$wpdb->querycount queries - ".number_format(timer_stop(),3)." seconds
"; } ?> diff --git a/b2comments.php b/b2comments.php index 33ea662c77..e4e7a70a90 100644 --- a/b2comments.php +++ b/b2comments.php @@ -15,7 +15,6 @@ $comment_author_url = (isset($HTTP_COOKIE_VARS['comment_author_url_'.$cookiehash])) ? trim($HTTP_COOKIE_VARS['comment_author_url_'.$cookiehash]) : ''; $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date"); - ++$querycount; ?> diff --git a/b2comments.post.php b/b2comments.post.php index 9eef3413e7..bc38ebb4ee 100644 --- a/b2comments.post.php +++ b/b2comments.post.php @@ -39,7 +39,6 @@ $user_ip = $HTTP_SERVER_VARS['REMOTE_ADDR']; $user_domain = gethostbyaddr($user_ip); $commentstatus = $wpdb->get_var("SELECT comment_status FROM $tableposts WHERE ID = $comment_post_ID"); -++$querycount; if ('closed' == $commentstatus) die('Sorry, comments are closed for this item.'); @@ -68,7 +67,6 @@ $url = addslashes($url); /* Flood-protection */ $lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1"); -++$querycount; $ok = true; if (!empty($lasttime)) { $time_lastcomment= mysql2date('U', $lasttime); @@ -101,7 +99,6 @@ if ($ok) { // if there was no comment from this IP in the last 10 seconds "); $comment_ID = $wpdb->get_var('SELECT last_insert_id()'); - ++$querycount; if (($moderation_notify) && (!$approved)) { wp_notify_moderator($comment_ID); diff --git a/b2commentspopup.php b/b2commentspopup.php index 11f7cf12d7..a4bcddb184 100644 --- a/b2commentspopup.php +++ b/b2commentspopup.php @@ -30,9 +30,7 @@ foreach ($posts as $post) { start_b2(); get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date"); -++$querycount; $commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $tableposts WHERE ID = $id"); -++$querycount; if (!empty($commentstatus->post_password) && $HTTP_COOKIE_VARS['wp-postpass_'.$cookiehash] != $commentstatus->post_password) { // and it doesn't match the cookie echo(get_the_password_form()); } else { ?> diff --git a/b2login.php b/b2login.php index 2cb1931d91..2c6082968d 100644 --- a/b2login.php +++ b/b2login.php @@ -86,11 +86,9 @@ case 'login': $pass_is_md5 = 1; $password = substr($password, 4, strlen($password)); $query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND MD5(user_pass) = '$password'"; - ++$querycount; } else { $pass_is_md5 = 0; $query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND user_pass = '$password'"; - ++$querycount; } $login = $wpdb->get_row($query); diff --git a/b2mail.php b/b2mail.php index 3a850660a8..e9080de1eb 100644 --- a/b2mail.php +++ b/b2mail.php @@ -204,7 +204,6 @@ for ($iCount=1; $iCount<=$Count; $iCount++) { $sql = "SELECT ID, user_level FROM $tableusers WHERE user_login='$user_login' AND user_pass='$user_pass' ORDER BY ID DESC LIMIT 1"; $result = $wpdb->get_row($sql); - ++$querycount; if (!$result) { echo 'Wrong login or password.
'; diff --git a/b2register.php b/b2register.php index fcd09fc8fe..0d5cf1fc0c 100644 --- a/b2register.php +++ b/b2register.php @@ -80,7 +80,6 @@ case 'register': /* checking the login isn't already used by another user */ $result = $wpdb->get_results("SELECT user_login FROM $tableusers WHERE user_login = '$user_login'"); - ++$querycount; if (count($result) >= 1) { die ('ERROR: This login is already registered, please choose another one.'); } diff --git a/b2trackback.php b/b2trackback.php index db03f79179..18b8829198 100644 --- a/b2trackback.php +++ b/b2trackback.php @@ -31,7 +31,6 @@ if ((strlen(''.$tb_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen(''.$tb_u trackback_response(1, 'Sorry, this weblog does not allow you to trackback its posts.'); $pingstatus = $wpdb->get_var("SELECT ping_status FROM $tableposts WHERE ID = $tb_id"); - ++$querycount; if ('closed' == $pingstatus) trackback_response(1, 'Sorry, trackbacks are closed for this item.'); @@ -87,7 +86,6 @@ if ((strlen(''.$tb_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen(''.$tb_u die ("There is an error with the database, it can't store your comment...Powered by WordPress
+querycount; ?> queries. Powered by WordPress