From f8e2f4f2f4809c9c53fd8107aed1da6a094e4b3a Mon Sep 17 00:00:00 2001 From: saxmatt Date: Mon, 26 Apr 2004 19:18:25 +0000 Subject: [PATCH] More query reduction. git-svn-id: http://svn.automattic.com/wordpress/trunk@1184 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-blog-header.php | 3 +-- wp-includes/functions.php | 4 ++-- wp-settings.php | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-blog-header.php b/wp-blog-header.php index b968a6fb2e..bfcaaa6322 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -271,8 +271,7 @@ if ('' != $category_name) { } // author stuff -$auteurs = $wpdb->get_results("SELECT * FROM $tableusers WHERE 1=1"); -foreach ($auteurs as $auteur) { +foreach ($users as $auteur) { $cache_authors[$auteur->ID] = $auteur; } diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 782f1d09d1..6b32330687 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -175,8 +175,8 @@ function get_currentuserinfo() { // a bit like get_userdata(), on steroids } function get_userdata($userid) { - global $wpdb, $cache_userdata, $tableusers; - if ( empty($cache_userdata[$userid]) ) { + global $wpdb, $cache_authors, $tableusers; + if ( empty($cache_authors[$userid]) ) { $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID = '$userid'"); $user->user_nickname = stripslashes($user->user_nickname); $user->user_firstname = stripslashes($user->user_firstname); diff --git a/wp-settings.php b/wp-settings.php index ce1c07cf8a..4bcaf85c83 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -28,7 +28,8 @@ define('WPINC', 'wp-includes'); require_once (ABSPATH . WPINC . '/wp-db.php'); $wpdb->hide_errors(); -if (!$wpdb->get_row("SELECT * FROM $tableusers LIMIT 1") && !strstr($_SERVER['REQUEST_URI'], 'install.php')) { +$users = $wpdb->get_results("SELECT * FROM $tableusers"); +if (!$users && !strstr($_SERVER['REQUEST_URI'], 'install.php')) { die("It doesn't look like you've installed WP yet. Try running install.php."); } $wpdb->show_errors();