WordPress.org

Make WordPress Core

Changeset 570


Ignore:
Timestamp:
12/05/2003 01:27:00 AM (18 years ago)
Author:
mikelittle
Message:

Removed $querycount.

Location:
trunk
Files:
15 edited

Legend:

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

    r559 r570  
    374374
    375375function get_lastpostdate() {
    376     global $tableposts, $cache_lastpostdate, $use_cache, $time_difference, $pagenow, $wpdb, $querycount;
     376    global $tableposts, $cache_lastpostdate, $use_cache, $time_difference, $pagenow, $wpdb;
    377377    if ((!isset($cache_lastpostdate)) OR (!$use_cache)) {
    378378        $now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600)));
     
    383383        }
    384384        $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE $showcatzero post_date <= '$now' ORDER BY post_date DESC LIMIT 1");
    385         ++$querycount;
    386385        $cache_lastpostdate = $lastpostdate;
    387386//      echo $lastpostdate;
     
    416415
    417416function get_userdata($userid) {
    418     global $wpdb, $querycount, $cache_userdata, $use_cache, $tableusers;
     417    global $wpdb, $cache_userdata, $use_cache, $tableusers;
    419418    if ((empty($cache_userdata[$userid])) || (!$use_cache)) {
    420419        $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID = $userid");
     
    424423        $user->user_firstname =  stripslashes($user->user_firstname);
    425424        $user->user_lastname = stripslashes($user->user_lastname);
    426         ++$querycount;
    427425        $cache_userdata[$userid] = $user;
    428426    } else {
     
    446444
    447445function get_userdatabylogin($user_login) {
    448     global $tableusers, $querycount, $cache_userdata, $use_cache, $wpdb;
     446    global $tableusers, $cache_userdata, $use_cache, $wpdb;
    449447    if ((empty($cache_userdata["$user_login"])) OR (!$use_cache)) {
    450448        $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE user_login = '$user_login'");
    451         ++$querycount;
    452449        $cache_userdata["$user_login"] = $user;
    453450    } else {
     
    458455
    459456function get_userid($user_login) {
    460     global $tableusers, $querycount, $cache_userdata, $use_cache, $wpdb;
     457    global $tableusers, $cache_userdata, $use_cache, $wpdb;
    461458    if ((empty($cache_userdata["$user_login"])) OR (!$use_cache)) {
    462459        $user_id = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_login = '$user_login'");
    463460
    464         ++$querycount;
    465461        $cache_userdata["$user_login"] = $user_id;
    466462    } else {
     
    471467
    472468function get_usernumposts($userid) {
    473     global $tableposts, $tablecomments, $querycount, $wpdb;
    474     ++$querycount;
     469    global $tableposts, $tablecomments, $wpdb;
    475470    return $wpdb->get_var("SELECT COUNT(*) FROM $tableposts WHERE post_author = $userid");
    476471}
     
    479474// determine the post ID it represents.
    480475function url_to_postid($url = '') {
    481     global $wpdb, $querycount, $tableposts, $siteurl;
     476    global $wpdb, $tableposts, $siteurl;
    482477
    483478    // Take a link like 'http://example.com/blog/something'
     
    537532
    538533    // Run the query to get the post ID:
    539     ++$querycount;
    540534    return intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where));
    541535}
     
    545539
    546540function get_settings($setting) {
    547     global $wpdb, $cache_settings, $use_cache, $querycount;
     541    global $wpdb, $cache_settings, $use_cache;
    548542    if ((empty($cache_settings)) OR (!$use_cache)) {
    549543        $settings = get_alloptions();
     
    559553
    560554function get_alloptions() {
    561     global $tableoptions, $wpdb, $querycount;
     555    global $tableoptions, $wpdb;
    562556    $options = $wpdb->get_results("SELECT option_name, option_value FROM $tableoptions");
    563     ++$querycount;
    564557    if ($options) {
    565558        foreach ($options as $option) {
     
    583576
    584577function get_postdata($postid) {
    585     global $tableusers, $tablecategories, $tableposts, $tablecomments, $querycount, $wpdb;
     578    global $tableusers, $tablecategories, $tableposts, $tablecomments, $wpdb;
    586579    $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID = $postid");
    587     ++$querycount;
    588580   
    589581    $postdata = array (
     
    626618
    627619function get_commentdata($comment_ID,$no_cache=0,$include_unapproved=false) { // less flexible, but saves DB queries
    628     global $postc,$id,$commentdata,$tablecomments,$querycount, $wpdb;
     620    global $postc,$id,$commentdata,$tablecomments, $wpdb;
    629621    if ($no_cache) {
    630622        $query = "SELECT * FROM $tablecomments WHERE comment_ID = $comment_ID";
     
    633625        }
    634626            $myrow = $wpdb->get_row($query, ARRAY_A);
    635         ++$querycount;
    636627    } else {
    637628        $myrow['comment_ID']=$postc->comment_ID;
     
    656647
    657648function get_catname($cat_ID) {
    658     global $tablecategories,$cache_catnames,$use_cache,$querycount, $wpdb;
     649    global $tablecategories,$cache_catnames,$use_cache, $wpdb;
    659650    if ((!$cache_catnames) || (!$use_cache)) {
    660651        $results = $wpdb->get_results("SELECT * FROM $tablecategories") or die('Oops, couldn\'t query the db for categories.');
    661         $querycount++;
    662652        foreach ($results as $post) {
    663653            $cache_catnames[$post->cat_ID] = $post->cat_name;
     
    674664
    675665function dropdown_categories($blog_ID=1, $default=1) {
    676     global $postdata,$tablecategories,$mode,$querycount, $wpdb;
     666    global $postdata,$tablecategories,$mode, $wpdb;
    677667    $query="SELECT * FROM $tablecategories ORDER BY cat_name";
    678668    $results = $wpdb->get_results($query);
    679     ++$querycount;
    680669    $width = ($mode=="sidebar") ? "100%" : "170px";
    681670    echo '<select name="post_category" style="width:'.$width.';" tabindex="2" id="category">';
     
    683672        $default = $postdata["Category"];
    684673    }
    685     ++$querycount;
    686674    foreach($results as $post) {
    687675        echo "<option value=\"".$post->cat_ID."\"";
     
    14421430 */
    14431431function wp_get_comment_status($comment_id) {
    1444     global $wpdb, $querycount, $tablecomments;
     1432    global $wpdb, $tablecomments;
    14451433   
    14461434    $result = $wpdb->get_var("SELECT comment_approved FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
    1447     ++$querycount;
    14481435    if ($result == NULL) {
    14491436        return "deleted";
     
    14581445
    14591446function wp_notify_postauthor($comment_id, $comment_type) {
    1460     global $wpdb, $querycount, $tablecomments, $tableposts, $tableusers;
     1447    global $wpdb, $tablecomments, $tableposts, $tableusers;
    14611448    global $querystring_start, $querystring_equal, $querystring_separator;
    14621449    global $blogfilename, $blogname, $siteurl;
    14631450   
    14641451    $comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
    1465     ++$querycount;
    14661452    $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1");
    1467     ++$querycount;
    14681453    $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID='$post->post_author' LIMIT 1");
    1469     ++$querycount;
    14701454
    14711455    if ('' == $user->user_email) return false; // If there's no email to send the comment to
     
    15181502 */
    15191503function wp_notify_moderator($comment_id) {
    1520     global $wpdb, $querycount, $tablecomments, $tableposts, $tableusers;
     1504    global $wpdb, $tablecomments, $tableposts, $tableusers;
    15211505    global $querystring_start, $querystring_equal, $querystring_separator;
    15221506    global $blogfilename, $blogname, $siteurl;
    15231507   
    15241508    $comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
    1525     ++$querycount;
    15261509    $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1");
    1527     ++$querycount;
    15281510    $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID='$post->post_author' LIMIT 1");
    1529     ++$querycount;
    15301511
    15311512    $comment_author_domain = gethostbyaddr($comment->comment_author_IP);
    15321513    $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $tablecomments WHERE comment_approved = '0'");
    1533     ++$querycount;
    15341514
    15351515    $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";
  • trunk/b2-include/b2template.functions.php

    r565 r570  
    127127function get_archives($type='', $limit='', $format='html', $before = "", $after = "", $show_post_count = false) {
    128128    global $tableposts, $dateformat, $time_difference, $siteurl, $blogfilename;
    129     global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week, $querycount;
     129    global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week;
    130130
    131131    if ('' == $type) {
     
    164164
    165165    if ('monthly' == $type) {
    166         ++$querycount;
    167166        $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $tableposts WHERE post_date < '$now' AND post_category > 0 AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);
    168167        if ($arcresults) {
     
    179178        }
    180179    } elseif ('daily' == $type) {
    181         ++$querycount;
    182180        $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth` FROM $tableposts WHERE post_date < '$now' AND post_category > 0 AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
    183181        if ($arcresults) {
     
    193191            $start_of_week = 1;
    194192        }
    195         ++$querycount;
    196193        $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd FROM $tableposts WHERE post_date < '$now' AND post_category > 0 AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
    197194        $arc_w_last = '';
     
    213210        }
    214211    } elseif ('postbypost' == $type) {
    215         ++$querycount;
    216212        $arcresults = $wpdb->get_results("SELECT ID, post_date, post_title FROM $tableposts WHERE post_date < '$now' AND post_category > 0 AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
    217213        if ($arcresults) {
     
    233229
    234230function get_calendar($daylength = 1) {
    235     global $wpdb, $HTTP_GET_VARS, $m, $monthnum, $year, $timedifference, $month, $weekday, $tableposts, $posts, $querycount;
     231    global $wpdb, $HTTP_GET_VARS, $m, $monthnum, $year, $timedifference, $month, $weekday, $tableposts, $posts;
    236232
    237233    // Quick check. If we have no posts at all, abort!
    238234    if (!$posts) {
    239235        $gotsome = $wpdb->get_var("SELECT ID from $tableposts WHERE post_status = 'publish' AND post_category > 0 ORDER BY post_date DESC LIMIT 1");
    240         ++$querycount;
    241236        if (!$gotsome)
    242237            return;
     
    255250        $d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's
    256251        $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')");
    257         ++$querycount;
    258252    } elseif (!empty($m)) {
    259253        $calendar = substr($m, 0, 6);
     
    278272                              ORDER BY post_date DESC
    279273                              LIMIT 1");
    280     ++$querycount;
    281274    $next = $wpdb->get_row("SELECT  DISTINCT MONTH( post_date ) AS month, YEAR( post_date ) AS year
    282275            FROM $tableposts
     
    286279                              ORDER  BY post_date ASC
    287280                              LIMIT 1");
    288     ++$querycount;
    289281
    290282    echo '<table id="wp-calendar">
     
    334326            AND post_status = 'publish'
    335327            AND post_date < '" . date("Y-m-d H:i:s", (time() + ($time_difference * 3600)))."'", ARRAY_N);
    336     ++$querycount;
    337328    if ($dayswithposts) {
    338329        foreach ($dayswithposts as $daywith) {
     
    360351                                         ."AND post_status = 'publish'"
    361352                                        );
    362     ++$querycount;
    363353    if ($ak_post_titles) {
    364354        foreach ($ak_post_titles as $ak_post_title) {
     
    411401function get_permalink($id=false) {
    412402    global $post, $wpdb, $tableposts;
    413     global $siteurl, $blogfilename, $querystring_start, $querystring_equal, $querycount;
     403    global $siteurl, $blogfilename, $querystring_start, $querystring_equal;
    414404
    415405    $rewritecode = array(
     
    435425    } else { // if an ID is given
    436426        $idpost = $wpdb->get_row("SELECT post_date, post_name FROM $tableposts WHERE ID = $id");
    437         ++$querycount;
    438427        if ('' != get_settings('permalink_structure')) {
    439428            $unixtime = strtotime($idpost->post_date);
     
    10351024
    10361025function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
    1037     global $tableposts, $id, $post, $siteurl, $blogfilename, $querycount, $wpdb;
     1026    global $tableposts, $id, $post, $siteurl, $blogfilename, $wpdb;
    10381027    global $p, $posts, $posts_per_page, $s, $single;
    10391028    global $querystring_start, $querystring_equal, $querystring_separator;
     
    10601049        $limitprev--;
    10611050        $lastpost = @$wpdb->get_row("SELECT ID, post_title FROM $tableposts WHERE post_date < '$current_post_date' AND post_category > 0 AND post_status = 'publish' $sqlcat $sql_exclude_cats ORDER BY post_date DESC LIMIT $limitprev, 1");
    1062         ++$querycount;
    10631051        if ($lastpost) {
    10641052            $string = '<a href="'.get_permalink($lastpost->ID).'">'.$previous;
     
    10741062
    10751063function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
    1076     global $tableposts, $p, $posts, $id, $post, $siteurl, $blogfilename, $querycount, $wpdb;
     1064    global $tableposts, $p, $posts, $id, $post, $siteurl, $blogfilename, $wpdb;
    10771065    global $time_difference, $single;
    10781066    global $querystring_start, $querystring_equal, $querystring_separator;
     
    11011089
    11021090        $nextpost = @$wpdb->get_row("SELECT ID,post_title FROM $tableposts WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_category > 0 AND post_status = 'publish' $sqlcat $sql_exclude_cats ORDER BY post_date ASC LIMIT $limitnext,1");
    1103         ++$querycount;
    11041091        if ($nextpost) {
    11051092            $string = '<a href="'.get_permalink($nextpost->ID).'">'.$next;
     
    12861273
    12871274function get_the_category_by_ID($cat_ID) {
    1288     global $tablecategories, $querycount, $cache_categories, $use_cache, $wpdb;
     1275    global $tablecategories, $cache_categories, $use_cache, $wpdb;
    12891276    if ((!$cache_categories[$cat_ID]) OR (!$use_cache)) {
    12901277        $cat_name = $wpdb->get_var("SELECT cat_name FROM $tablecategories WHERE cat_ID = '$cat_ID'");
    1291         ++$querycount;
    12921278        $cache_categories[$cat_ID] = $cat_name;
    12931279    } else {
     
    13191305function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc',
    13201306                       $optiondates = 0, $optioncount = 0, $hide_empty = 1) {
    1321     global $cat, $tablecategories, $tableposts, $querycount, $wpdb;
     1307    global $cat, $tablecategories, $tableposts, $wpdb;
    13221308    $sort_column = 'cat_'.$sort_column;
    13231309
     
    13341320
    13351321    $categories = $wpdb->get_results($query);
    1336     ++$querycount;
    13371322    echo "<select name='cat' class='postform'>\n";
    13381323    if (intval($optionall) == 1) {
     
    13621347function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc',
    13631348                   $file = 'blah', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1) {
    1364     global $tablecategories, $tableposts, $querycount, $wpdb;
     1349    global $tablecategories, $tableposts, $wpdb;
    13651350    global $pagenow, $siteurl, $blogfilename;
    13661351    global $querystring_start, $querystring_equal, $querystring_separator;
     
    13821367
    13831368    $categories = $wpdb->get_results($query);
    1384     ++$querycount;
    13851369    if (!$categories) {
    13861370        if ($list) {
     
    14351419
    14361420function comments_number($zero='No Comments', $one='1 Comment', $more='% Comments', $include_unapproved = false) {
    1437     global $id, $comment, $tablecomments, $querycount, $wpdb;
     1421    global $id, $comment, $tablecomments, $wpdb;
    14381422    $query = "SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id";
    14391423    if (false == $include_unapproved) {
     
    14411425    }
    14421426    $number = $wpdb->get_var($query);
    1443     ++$querycount;
    14441427    if ($number == 0) {
    14451428        $blah = $zero;
     
    14701453
    14711454function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
    1472     global $id, $b2commentspopupfile, $b2commentsjavascript, $post, $wpdb, $querycount, $tablecomments, $HTTP_COOKIE_VARS, $cookiehash;
     1455    global $id, $b2commentspopupfile, $b2commentsjavascript, $post, $wpdb, $tablecomments, $HTTP_COOKIE_VARS, $cookiehash;
    14731456    global $querystring_start, $querystring_equal, $querystring_separator, $siteurl;
    14741457    $number = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1'");
    1475     ++$querycount;
    14761458    if (0 == $number && 'closed' == $post->comment_status) {
    14771459        echo $none;
  • trunk/wp-admin/b2team.php

    r558 r570  
    104104    <?php
    105105    $users = $wpdb->get_results("SELECT ID FROM $tableusers WHERE user_level>0 ORDER BY ID");
    106     ++$querycount;
    107106    foreach ($users as $user) {
    108107        $user_data = get_userdata($user->ID);
     
    140139<?php
    141140    $users = $wpdb->get_results("SELECT * FROM $tableusers WHERE user_level=0 ORDER BY ID");
    142     ++$querycount;
    143141    if ($users) {
    144142?>
  • trunk/wp-admin/b2verifauth.php

    r558 r570  
    66function veriflog() {
    77    global $HTTP_COOKIE_VARS,$cookiehash;
    8     global $tableusers, $wpdb, $querycount;
     8    global $tableusers, $wpdb;
    99
    1010    if (!empty($HTTP_COOKIE_VARS["wordpressuser_".$cookiehash])) {
     
    2121
    2222    $login = $wpdb->get_row("SELECT user_login, user_pass FROM $tableusers WHERE user_login = '$user_login'");
    23     ++$querycount;
    2423
    2524    if (!$login) {
  • trunk/wp-admin/edit-comments.php

    r560 r570  
    137137                                    LIMIT $commentstart, $commentend"
    138138                                  );
    139     ++$querycount;
    140139
    141140// need to account for offet, etc.
  • trunk/wp-admin/edit.php

    r560 r570  
    146146        <?php
    147147    $categories = $wpdb->get_results("SELECT * FROM $tablecategories");
    148     $querycount++;
    149148    $width = ($mode=="sidebar") ? "100%" : "170px";
    150149    foreach ($categories as $category) {
     
    165164    if ($archive_mode == "monthly") {
    166165        echo "<select name=\"m\" style=\"width:120px;\">";
    167         $querycount++;
    168166        $arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date) FROM $tableposts ORDER BY post_date DESC",ARRAY_A);
    169167        foreach ($arc_result as $arc_row) {
     
    177175        echo "<select name=\"d\" style=\"width:120px;\">";
    178176        $archive_day_date_format = "Y/m/d";
    179         $querycount++;
    180177        $arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) FROM $tableposts ORDER BY post_date DESC", ARRAY_A);
    181178        foreach ($arc_result as $arc_row) {
     
    195192        $archive_week_end_date_format   = "Y/m/d";
    196193        $archive_week_separator = " - ";
    197         $querycount++;
    198194        $arc_result=$wpdb->geT_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date), WEEK(post_date) FROM $tableposts ORDER BY post_date DESC", ARRAY_A);
    199195        $arc_w_last = '';
     
    215211        echo '<input type="hidden" name="more" value="1" />';
    216212        echo '<select name="p" style="width:120px;">';
    217         $querycount++;
    218213        $resultarc = $wpdb->get_results("SELECT ID,post_date,post_title FROM $tableposts ORDER BY post_date DESC");
    219214        foreach ($resultarc as $row) {
     
    269264
    270265                    $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
    271                     ++$querycount;
    272266                    if ($comments) {
    273267                    ?>
  • trunk/wp-admin/import-b2.php

    r558 r570  
    140140    $query = "SELECT link_updated FROM $tablelinks LIMIT 1";
    141141    $q = @mysql_query($query);
    142     ++$querycount;
    143142    if ($q != false) {
    144143        if ($row = mysql_fetch_object($q)) {
     
    152151    echo "<p>Looking for column link_rel...</p>\n";
    153152    $query = "SELECT link_rel FROM $tablelinks LIMIT 1";
    154     ++$querycount;
    155153    $q = @mysql_query($query);
    156154    if ($q != false) {
     
    169167    echo "<p>Looking for category 1...</p>\n";
    170168    $sql = "SELECT * FROM $tablelinkcategories WHERE cat_id=1 ";
    171     ++$querycount;
    172169    $result = mysql_query($sql) or print ("Can't query '$tablelinkcategories'.<br />" . $sql . "<br />" . mysql_error());
    173170    if ($result != false) {
  • trunk/wp-admin/import-blogger.php

    r558 r570  
    7070            // we'll check the author is registered already
    7171            $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE user_login = '$post_author'");
    72             ++$querycount;
    7372            if (!$user) { // seems s/he's not, so let's register
    7473                $user_ip = '127.0.0.1';
     
    113112
    114113            $post_author_ID = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_login = '$post_author'");
    115             ++$querycount;
    116114
    117115            $post_date = explode(' ', $post_date);
     
    137135            // Quick-n-dirty check for dups:
    138136            $dupcheck = $wpdb->get_results("SELECT ID,post_date,post_title FROM $tableposts WHERE post_date='$post_date' AND post_title='$post_title' LIMIT 1",ARRAY_A);
    139             ++$querycount;
    140137            if ($dupcheck[0]['ID']) {
    141138                print "<br />\nSkipping duplicate post, ID = '" . $dupcheck[0]['ID'] . "'<br />\n";
  • trunk/wp-admin/import-greymatter.php

    r558 r570  
    140140            $sql = "SELECT * FROM $tableusers WHERE user_login = '$post_author'";
    141141            $result = mysql_query($sql);
    142             ++$querycount;
    143142            if (!mysql_num_rows($result)) { // if deleted from GM, we register the author as a level 0 user in b2
    144143                $user_ip="127.0.0.1";
     
    161160
    162161            $sql = "SELECT * FROM $tableusers WHERE user_login = '$post_author'";
    163             ++$querycount;
    164162            $result = mysql_query($sql);
    165163            $myrow = mysql_fetch_array($result);
     
    198196           
    199197            $sql2 = "SELECT * FROM $tableposts WHERE 1=1 ORDER BY ID DESC LIMIT 1";
    200             ++$querycount;
    201198            $result2 = mysql_query($sql2);
    202199            $myrow2 = mysql_fetch_array($result2);
  • trunk/wp-admin/import-textpattern.php

    r558 r570  
    8181// For now we're going to give everything the same author and same category
    8282$author = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_level = 10 LIMIT 1");
    83 ++$querycount;
    8483$category = $wpdb->get_var("SELECT cat_ID FROM $tablecategories LIMIT 1");
    85 ++$querycount;
    8684
    8785$posts = mysql_query('SELECT * FROM textpattern', $connection);
    88 ++$querycount;
    8986
    9087while ($post = mysql_fetch_array($posts)) {
     
    112109    // Get wordpress post id
    113110    $wp_post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
    114     ++$querycount;
    115111   
    116112    // Now let's insert comments if there are any for the TP post
    117113    $tp_id = $post['ID'];
    118114    $comments = mysql_query("SELECT * FROM txp_Discuss WHERE parentid = $tp_id");
    119     ++$querycount;
    120115    if ($comments) {
    121116        while($comment = mysql_fetch_object($comments)) {
  • trunk/wp-admin/linkcategories.php

    r558 r570  
    135135         . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
    136136         . " text_after_all, list_limit FROM $tablelinkcategories WHERE cat_id=$cat_id");
    137     ++$querycount;
    138137    if ($row) {
    139138        if ($row->list_limit == -1) {
     
    326325         . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
    327326         . " text_after_all, list_limit FROM $tablelinkcategories ORDER BY cat_id");
    328 ++$querycount;
    329327foreach ($results as $row) {
    330328    if ($row->list_limit == -1) {
  • trunk/wp-admin/linkmanager.php

    r558 r570  
    3434
    3535function category_dropdown($fieldname, $selected = 0) {
    36     global $wpdb, $querycount, $tablelinkcategories;
     36    global $wpdb, $tablelinkcategories;
    3737
    3838    $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
    39     ++$querycount;
    4039    echo '        <select name="'.$fieldname.'" size="1">'."\n";
    4140    foreach ($results as $row) {
     
    111110    $all_links = join(',', $linkcheck);
    112111    $results = $wpdb->get_results("SELECT link_id, link_owner, user_level FROM $tablelinks LEFT JOIN $tableusers ON link_owner = ID WHERE link_id in ($all_links)");
    113     ++$querycount;
    114112    foreach ($results as $row) {
    115113      if (!get_settings('links_use_adminlevels') || ($user_level >= $row->user_level)) { // ok to proceed
     
    141139    $all_links = join(',', $linkcheck);
    142140    $results = $wpdb->get_results("SELECT link_id, link_visible FROM $tablelinks WHERE link_id in ($all_links)");
    143     ++$querycount;
    144141    foreach ($results as $row) {
    145142        if ($row->link_visible == 'Y') { // ok to proceed
     
    308305      " FROM $tablelinks " .
    309306      " WHERE link_id = $link_id");
    310     ++$querycount;
    311307
    312308    if ($row) {
     
    503499<?php
    504500    $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
    505     ++$querycount;
    506501    echo "        <select name=\"cat_id\">\n";
    507502    echo "          <option value=\"All\"";
     
    566561            LEFT JOIN $tablelinkcategories ON $tablelinks.link_category = $tablelinkcategories.cat_id
    567562            LEFT JOIN $tableusers ON $tableusers.ID = $tablelinks.link_owner ";
    568     ++$querycount;
    569563
    570564    if (isset($cat_id) && ($cat_id != 'All')) {
     
    637631<?php
    638632    $results = $wpdb->get_results("SELECT ID, user_login FROM $tableusers WHERE user_level > 0 ORDER BY ID");
    639     ++$querycount;
    640633    echo "          <select name=\"newowner\" size=\"1\">\n";
    641634    foreach ($results as $row) {
  • trunk/wp-admin/links.import.php

    r558 r570  
    7474<?php
    7575    $categories = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
    76     ++$querycount;
    7776    foreach ($categories as $category) {
    7877?>
  • trunk/wp-admin/optionhandler.php

    r558 r570  
    5151                                         ."WHERE option_id = $option_result->option_id "
    5252                                         ."ORDER BY optionvalue_seq");
    53             ++$querycount;
    5453            if ($select) {
    5554                foreach($select as $option) {
     
    6968            // first get the sql to run
    7069            $sql = $wpdb->get_var("SELECT optionvalue FROM $tableoptionvalues WHERE option_id = $option_result->option_id");
    71             ++$querycount;
    7270            if (!$sql) {
    7371                return $option_result->option_name . $editable;
  • trunk/wp-admin/wp-edit.showposts.php

    r558 r570  
    146146        <?php
    147147    $categories = $wpdb->get_results("SELECT * FROM $tablecategories");
    148     $querycount++;
    149148    $width = ($mode=="sidebar") ? "100%" : "170px";
    150149    foreach ($categories as $category) {
     
    165164    if ($archive_mode == "monthly") {
    166165        echo "<select name=\"m\" style=\"width:120px;\">";
    167         $querycount++;
    168166        $arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date) FROM $tableposts ORDER BY post_date DESC",ARRAY_A);
    169167        foreach ($arc_result as $arc_row) {
     
    177175        echo "<select name=\"d\" style=\"width:120px;\">";
    178176        $archive_day_date_format = "Y/m/d";
    179         $querycount++;
    180177        $arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) FROM $tableposts ORDER BY post_date DESC", ARRAY_A);
    181178        foreach ($arc_result as $arc_row) {
     
    195192        $archive_week_end_date_format   = "Y/m/d";
    196193        $archive_week_separator = " - ";
    197         $querycount++;
    198194        $arc_result=$wpdb->geT_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date), WEEK(post_date) FROM $tableposts ORDER BY post_date DESC", ARRAY_A);
    199195        $arc_w_last = '';
     
    215211        echo '<input type="hidden" name="more" value="1" />';
    216212        echo '<select name="p" style="width:120px;">';
    217         $querycount++;
    218213        $resultarc = $wpdb->get_results("SELECT ID,post_date,post_title FROM $tableposts ORDER BY post_date DESC");
    219214        foreach ($resultarc as $row) {
     
    272267
    273268                    $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
    274                     ++$querycount;
    275269                    if ($comments) {
    276270                    ?>
Note: See TracChangeset for help on using the changeset viewer.