diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-02-06 15:33:12 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-02-06 15:33:12 +0000 |
commit | 89971da62cd480824941e9c59cb9b9af00851536 (patch) | |
tree | bba4b4e217d6c0f51f72208ea166500276896e78 | |
parent | 0a6e1f1dfc5c2e97586aca58f566b45f80b659e3 (diff) | |
download | wordpress-mu-89971da62cd480824941e9c59cb9b9af00851536.tar.gz wordpress-mu-89971da62cd480824941e9c59cb9b9af00851536.tar.xz wordpress-mu-89971da62cd480824941e9c59cb9b9af00851536.zip |
WP Merge to rev 3870
Added multi-blog stuff back into xmlrpc.php
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@882 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r-- | wp-config-sample.php | 2 | ||||
-rw-r--r-- | wp-includes/query.php | 6 | ||||
-rw-r--r-- | xmlrpc.php | 40 |
3 files changed, 30 insertions, 18 deletions
diff --git a/wp-config-sample.php b/wp-config-sample.php index 8f9d1d2..8e93ea1 100644 --- a/wp-config-sample.php +++ b/wp-config-sample.php @@ -4,6 +4,8 @@ define('DB_NAME', 'wordpress'); // The name of the database define('DB_USER', 'username'); // Your MySQL username define('DB_PASSWORD', 'password'); // ...and password define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value +define('DB_CHARSET', 'utf8'); +define('DB_COLLATE', ''); define('VHOST', 'VHOSTSETTING'); $base = 'BASE'; diff --git a/wp-includes/query.php b/wp-includes/query.php index 04a07df..01a28a9 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -794,16 +794,16 @@ class WP_Query { $in_cats = substr($in_cats, 0, -2);
$out_cats = substr($out_cats, 0, -2);
if ( strlen($in_cats) > 0 )
- $in_cats = " AND category_id IN ($in_cats)";
+ $in_cats = " AND $wpdb->post2cat.category_id IN ($in_cats)";
if ( strlen($out_cats) > 0 ) {
- $ids = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE category_id IN ($out_cats)");
+ $ids = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE $wpdb->post2cat.category_id IN ($out_cats)");
if ( is_array($ids) && count($ids > 0) ) {
foreach ( $ids as $id )
$out_posts .= "$id, ";
$out_posts = substr($out_posts, 0, -2);
}
if ( strlen($out_posts) > 0 )
- $out_cats = " AND ID NOT IN ($out_posts)";
+ $out_cats = " AND $wpdb->posts.ID NOT IN ($out_posts)";
else
$out_cats = '';
}
@@ -228,7 +228,7 @@ class wp_xmlrpc_server extends IXR_Server { "wp_page_parent_title" => $parent_title, "wp_page_order" => $page->menu_order, "wp_author_id" => $author->ID, - "wp_author_display_username" => $author->display_name + "wp_author_display_name" => $author->display_name ); return($page_struct); @@ -555,24 +555,34 @@ class wp_xmlrpc_server extends IXR_Server { $this->escape($args); - $user_login = $args[1]; - $user_pass = $args[2]; + $user_login = $args[1]; + $user_pass = $args[2]; - if (!$this->login_pass_ok($user_login, $user_pass)) { - return $this->error; - } + if (!$this->login_pass_ok($user_login, $user_pass)) + return $this->error; - set_current_user(0, $user_login); - $is_admin = current_user_can('level_8'); + $user = set_current_user(0, $user_login); + + $blogs = (array) get_blogs_of_user($user->ID); - $struct = array( - 'isAdmin' => $is_admin, - 'url' => get_option('home') . '/', - 'blogid' => '1', - 'blogName' => get_option('blogname') - ); + $struct = array(); - return array($struct); + foreach ( $blogs as $blog ) { + $blog_id = $blog->userblog_id; + + switch_to_blog($blog_id); + + $is_admin = current_user_can('level_8'); + + $struct[] = array( + 'isAdmin' => $is_admin, + 'url' => get_settings('home') . '/', + 'blogid' => $blog_id, + 'blogName' => get_settings('blogname') + ); + } + + return $struct; } |