diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-22 18:47:55 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-22 18:47:55 +0000 |
commit | 1a8522093c85332a60f61bea05eeae0bf82eb574 (patch) | |
tree | de84b39b4d3deceb6bba74d2238cfd9f83d04468 /wp-includes/wpmu-functions.php | |
parent | ff8977d11ad87b7f27d5addea30245abc269b912 (diff) | |
download | wordpress-mu-1a8522093c85332a60f61bea05eeae0bf82eb574.tar.gz wordpress-mu-1a8522093c85332a60f61bea05eeae0bf82eb574.tar.xz wordpress-mu-1a8522093c85332a60f61bea05eeae0bf82eb574.zip |
Better logic for getting blogs of user
update_blog_status() has optional param so that cache isn't updated immediately (useful for marking lots of blogs as spam)
Populate user_login field - noticed any blank user_logins?
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@859 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/wpmu-functions.php')
-rw-r--r-- | wp-includes/wpmu-functions.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index f73acd7..5cc543d 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -432,7 +432,7 @@ function get_blogs_of_user( $id, $all = false ) { if ( strstr( $key, '_capabilities') && strstr( $key, 'wp_') ) { preg_match('/wp_(\d+)_capabilities/', $key, $match); $blog = get_blog_details( $match[1] ); - if ( $blog && isset( $blog->domain ) && ( $all == false && $blog->deleted == 0 || $all == true ) ) { + if ( $blog && isset( $blog->domain ) && ( $all == true || $all == false && ( $blog->archived == 0 && $blog->spam == 0 && $blog->deleted == 0 ) ) ) { $blogs[$match[1]]->userblog_id = $match[1]; $blogs[$match[1]]->domain = $blog->domain; $blogs[$match[1]]->path = $blog->path; @@ -494,12 +494,13 @@ function update_archived( $id, $archived ) { return $archived; } -function update_blog_status( $id, $pref, $value ) { +function update_blog_status( $id, $pref, $value, $refresh = 1 ) { global $wpdb; $wpdb->query( "UPDATE {$wpdb->blogs} SET {$pref} = '{$value}', last_updated = NOW() WHERE blog_id = '$id'" ); - refresh_blog_details($id); + if( $refresh == 1 ) + refresh_blog_details($id); if( $pref == 'spam' ) { if( $value == 1 ) { @@ -659,6 +660,7 @@ function add_user_to_blog( $blog_id, $user_id, $role ) { $userdata = array(); $userdata['ID'] = $user->id; $userdata['user_url'] = get_blogaddress_by_id($blog_id); + $userdata['user_login'] = $user->user_login; wp_update_user($userdata); } |