From 717855f007fee1d5372fbb61b8dd0b9382bc8bc4 Mon Sep 17 00:00:00 2001
From: Matt Mullenweg
Date: Mon, 24 May 2004 08:22:18 +0000
Subject: [PATCH] Giant commit, sorry mailing list people. Move all table names
to new $wpdb versions. Works but the whole app needs thorough testing now.
git-svn-id: https://develop.svn.wordpress.org/trunk@1355 602fd350-edb4-49c9-b593-d223f7449a82
---
wp-admin/admin-functions.php | 44 +-
wp-admin/admin-header.php | 2 +-
wp-admin/auth.php | 4 +-
wp-admin/categories.php | 14 +-
wp-admin/edit-comments.php | 16 +-
wp-admin/edit.php | 6 +-
wp-admin/import-b2.php | 60 +-
wp-admin/import-blogger.php | 12 +-
wp-admin/import-greymatter.php | 22 +-
wp-admin/import-livejournal.php | 10 +-
wp-admin/import-mt.php | 46 +-
wp-admin/import-rss.php | 22 +-
wp-admin/import-textpattern.php | 14 +-
wp-admin/install-helper.php | 10 +-
wp-admin/install.php | 504 ++++++-------
wp-admin/link-add.php | 4 +-
wp-admin/link-categories.php | 12 +-
wp-admin/link-import.php | 4 +-
wp-admin/link-manager.php | 42 +-
wp-admin/moderation.php | 4 +-
wp-admin/optionhandler.php | 10 +-
wp-admin/options-head.php | 2 +-
wp-admin/options-writing.php | 2 +-
wp-admin/options.php | 12 +-
wp-admin/post.php | 42 +-
wp-admin/profile.php | 2 +-
wp-admin/upgrade-functions.php | 775 ++++++++++----------
wp-admin/users.php | 28 +-
wp-blog-header.php | 3 +-
wp-comments-popup.php | 4 +-
wp-comments-post.php | 6 +-
wp-comments-reply.php | 2 +-
wp-comments.php | 2 +-
wp-commentsrss2.php | 12 +-
wp-includes/functions-post.php | 43 +-
wp-includes/functions.php | 143 ++--
wp-includes/links-update-xml.php | 8 +-
wp-includes/links.php | 43 +-
wp-includes/template-functions-author.php | 6 +-
wp-includes/template-functions-category.php | 46 +-
wp-includes/template-functions-comment.php | 8 +-
wp-includes/template-functions-general.php | 29 +-
wp-includes/template-functions-links.php | 4 +-
wp-includes/template-functions-post.php | 8 +-
wp-includes/wp-db.php | 15 +
wp-links-opml.php | 12 +-
wp-login.php | 6 +-
wp-mail.php | 6 +-
wp-register.php | 4 +-
wp-settings.php | 34 +-
wp-trackback.php | 4 +-
xmlrpc.php | 22 +-
52 files changed, 1099 insertions(+), 1096 deletions(-)
diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index 48873785ec..0168f5a1d8 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -19,19 +19,19 @@ function checked($checked, $current) {
}
function get_nested_categories($default = 0) {
- global $post_ID, $tablecategories, $tablepost2cat, $mode, $wpdb;
+ global $post_ID, $mode, $wpdb;
if ($post_ID) {
$checked_categories = $wpdb->get_col("
SELECT category_id
- FROM $tablecategories, $tablepost2cat
- WHERE $tablepost2cat.category_id = cat_ID AND $tablepost2cat.post_id = '$post_ID'
+ FROM $wpdb->categories, $wpdb->post2cat
+ WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$post_ID'
");
} else {
$checked_categories[] = $default;
}
- $categories = $wpdb->get_results("SELECT * FROM $tablecategories ORDER BY category_parent DESC, cat_name ASC");
+ $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY category_parent DESC, cat_name ASC");
$result = array();
foreach($categories as $category) {
$array_category = get_object_vars($category);
@@ -66,14 +66,14 @@ function dropdown_categories($default = 0) {
// Dandy new recursive multiple category stuff.
function cat_rows($parent = 0, $level = 0, $categories = 0) {
- global $wpdb, $tablecategories, $tablepost2cat, $bgcolor;
+ global $wpdb, $bgcolor;
if (!$categories) {
- $categories = $wpdb->get_results("SELECT * FROM $tablecategories ORDER BY cat_name");
+ $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
}
if ($categories) {
foreach ($categories as $category) {
if ($category->category_parent == $parent) {
- $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $tablepost2cat WHERE category_id = $category->cat_ID");
+ $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $wpdb->post2cat WHERE category_id = $category->cat_ID");
$pad = str_repeat('— ', $level);
$bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee';
@@ -91,13 +91,13 @@ function cat_rows($parent = 0, $level = 0, $categories = 0) {
}
function wp_dropdown_cats($currentcat, $currentparent = 0, $parent = 0, $level = 0, $categories = 0) {
- global $wpdb, $tablecategories, $tablepost2cat, $bgcolor;
+ global $wpdb, $bgcolor;
if (!$categories) {
- $categories = $wpdb->get_results("SELECT * FROM $tablecategories ORDER BY cat_name");
+ $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
}
if ($categories) {
foreach ($categories as $category) { if ($currentcat != $category->cat_ID && $parent == $category->category_parent) {
- $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $tablepost2cat WHERE category_id = $category->cat_ID");
+ $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $wpdb->post2cat WHERE category_id = $category->cat_ID");
$pad = str_repeat('– ', $level);
echo "\n\t
@@ -119,7 +119,7 @@ if ('view' == $mode) {
' . __('Actions') . ' |
';
foreach ($comments as $comment) {
- $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $tableposts WHERE ID = $comment->comment_post_ID"));
+ $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
$bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee';
?>
diff --git a/wp-admin/edit.php b/wp-admin/edit.php
index d7da3e00ad..0bddce9820 100644
--- a/wp-admin/edit.php
+++ b/wp-admin/edit.php
@@ -12,7 +12,7 @@ require_once('admin-header.php');
get_results("SELECT ID, post_title FROM $tableposts WHERE post_status = 'draft' AND post_author = $user_ID");
+$drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID");
if ($drafts) {
?>
@@ -47,7 +47,7 @@ if( isset( $_GET['m'] ) )