diff --git a/b2-include/b2functions.php b/b2-include/b2functions.php index fd568de5fc..f743e33a28 100644 --- a/b2-include/b2functions.php +++ b/b2-include/b2functions.php @@ -478,7 +478,7 @@ function get_usernumposts($userid) { // examine a url (supposedly from this blog) and try to // determine the post ID it represents. function url_to_postid($url = '') { - global $wpdb, $tableposts, $siteurl; + global $wpdb, $querycount, $tableposts, $siteurl; // Take a link like 'http://example.com/blog/something' // and extract just the '/something': @@ -536,7 +536,8 @@ function url_to_postid($url = '') { if ($postname) $where .= " AND post_name = '" . $wpdb->escape($postname) . "' "; // Run the query to get the post ID: - return intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where)); + ++$querycount; + return intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where)); } @@ -681,6 +682,7 @@ function dropdown_categories($blog_ID=1, $default=1) { if ($postdata["Category"] != '') { $default = $postdata["Category"]; } + ++$querycount; foreach($results as $post) { echo "