From 85e815bf00f6a27fbe1ed1fb3e0d3e2a2a7fe040 Mon Sep 17 00:00:00 2001 From: donncha Date: Wed, 16 Apr 2008 14:40:34 +0000 Subject: Applied patch in #590 by momo360modena and fixed a minor bug with blog searching git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1237 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/users.php | 25 ++-- wp-admin/wpmu-admin.php | 40 ++++- wp-admin/wpmu-blogs.php | 179 +++++++++-------------- wp-admin/wpmu-edit.php | 24 ++- wp-admin/wpmu-options.php | 325 ++++++++++++++++++++--------------------- wp-admin/wpmu-themes.php | 21 +-- wp-admin/wpmu-upgrade-site.php | 4 +- wp-admin/wpmu-users.php | 194 ++++++++++-------------- wp-includes/wpmu-functions.php | 35 +++-- 9 files changed, 401 insertions(+), 446 deletions(-) diff --git a/wp-admin/users.php b/wp-admin/users.php index c58e3f7..b4b2e9d 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -506,24 +506,25 @@ foreach ( $wp_user_search->get_results() as $userid ) {
-

+

- - - + +
+ + + + + - +
+ +

diff --git a/wp-admin/wpmu-admin.php b/wp-admin/wpmu-admin.php index 3079ea0..ac70271 100644 --- a/wp-admin/wpmu-admin.php +++ b/wp-admin/wpmu-admin.php @@ -3,28 +3,48 @@ require_once('admin.php'); $title = __('WordPress MU › Admin'); $parent_file = 'wpmu-admin.php'; + +function index_css() { + wp_admin_css( 'css/dashboard' ); +} +add_action( 'admin_head', 'index_css' ); + require_once('admin-header.php'); if( is_site_admin() == false ) { wp_die( __('

You do not have permission to access this page.

') ); } -if (isset($_GET['updated'])) { - ?> -

- get_var("SELECT COUNT(id) FROM {$wpdb->users}"); +$c_blogs = $wpdb->get_var("SELECT COUNT(blog_id) FROM {$wpdb->blogs}"); + +$user_text = sprintf( __ngettext( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) ); +$blog_text = sprintf( __ngettext( '%s blog', '%s blogs', $c_blogs ), number_format_i18n( $c_blogs ) ); + +$sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text ); ?>

+ +
+

+ + + + +
+

+ +

- " /> + " />

@@ -32,9 +52,13 @@ if (isset($_GET['updated'])) {

- " /> + " />

+ + + +
- \ No newline at end of file + diff --git a/wp-admin/wpmu-blogs.php b/wp-admin/wpmu-blogs.php index 9fc26c9..badf311 100644 --- a/wp-admin/wpmu-blogs.php +++ b/wp-admin/wpmu-blogs.php @@ -3,7 +3,10 @@ require_once('admin.php'); $title = __('WordPress MU › Admin › Blogs'); $parent_file = 'wpmu-admin.php'; + wp_enqueue_script( 'listman' ); +wp_enqueue_script( 'admin-forms' ); + require_once('admin-header.php'); if( is_site_admin() == false ) { wp_die( __('

You do not have permission to access this page.

') ); @@ -15,6 +18,9 @@ if ( $_GET['updated'] == 'true' ) {

blogs} WHERE site_id = '{$wpdb->siteid}' "; - if( !empty($_GET['s']) ) { + if( isset($_GET['blog_name']) ) { $s = trim($_GET['s']); $query = "SELECT blog_id, {$wpdb->blogs}.domain, {$wpdb->blogs}.path, registered, last_updated FROM {$wpdb->blogs}, {$wpdb->site} WHERE site_id = '{$wpdb->siteid}' AND {$wpdb->blogs}.site_id = {$wpdb->site}.id AND ( {$wpdb->blogs}.domain LIKE '%{$s}%' OR {$wpdb->blogs}.path LIKE '%{$s}%' )"; - } elseif( !empty($_GET['blog_id']) ) { + } elseif( isset($_GET['blog_id']) ) { $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' - AND blog_id = '".intval($_GET['blog_id'])."'"; - } elseif( !empty($_GET['ip_address']) ) { + AND blog_id = '".intval($_GET['s'])."'"; + } elseif( isset($_GET['blog_ip']) ) { $query = "SELECT * FROM {$wpdb->blogs}, {$wpdb->registration_log} WHERE site_id = '{$wpdb->siteid}' AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id - AND {$wpdb->registration_log}.IP LIKE ('%".$_GET['ip_address']."%')"; + AND {$wpdb->registration_log}.IP LIKE ('%".$_GET['s']."%')"; } if( isset( $_GET['sortby'] ) == false ) { @@ -321,7 +327,7 @@ switch( $_GET['action'] ) { $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC'; - if( !empty($_GET['s']) || !empty($_GET['blog_id']) || !empty($_GET['ip_address'])) { + if( !empty($_GET['s']) ) { $blog_list = $wpdb->get_results( $query, ARRAY_A ); $total = count($blog_list); } else { @@ -341,83 +347,52 @@ switch( $_GET['action'] ) { 'current' => $apage )); ?> - -

+ +

-
- $blog_navigation

"; ?> -
-
- -
- - -
- -
- - -
- -
- - -
- + + + + + +
- + +
-
+
+ $blog_navigation
"; ?> + +
+ + + + +
+
+
+ +

- - + + 'display name' + $blogname_columns = ( constant( "VHOST" ) == 'yes' ) ? __('Domain') : __('Path'); $posts_columns = array( - 'id' => __('ID'), - 'blogname' => __('Blog Name'), - 'lastupdated' => __('Last Updated'), - 'registered' => __('Registered'), - 'users' => __('Users'), - 'plugins' => __('Actions') + 'id' => __('ID'), + 'blogname' => $blogname_columns, + 'lastupdated' => __('Last Updated'), + 'registered' => __('Registered'), + 'users' => __('Users'), + 'plugins' => __('Actions') ); $posts_columns = apply_filters('manage_posts_columns', $posts_columns); // you can not edit these at the moment - $posts_columns['control_view'] = ''; $posts_columns['control_edit'] = ''; $posts_columns['control_backend'] = ''; $posts_columns['control_deactivate']= ''; @@ -427,20 +402,21 @@ switch( $_GET['action'] ) { $sortby_url = "s=" . $_GET['s'] . "&ip_address=" . $_GET['ip_address']; ?> - - - $column_display_name) { ?> - + $column_display_name) { + $column_link = " + + $col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link; + ?> + @@ -465,15 +441,18 @@ switch( $_GET['action'] ) { foreach( $posts_columns as $column_name=>$column_display_name ) { switch($column_name) { case 'id': ?> + - -
+ ' name='allblogs[]' value='' /> + - ' name='allblogs[]' value='' /> + - + - - " . __('Edit') . ""; ?> @@ -596,31 +569,15 @@ switch( $_GET['action'] ) {
- -
- $blog_navigation

"; ?> -
- - -

-
    -
  • -
  • -
- -

- - ' /> - ' />

- +

- - +
+ - - - - + + + + + + + + + + +
@@ -630,12 +587,20 @@ switch( $_GET['action'] ) {

- +

+

$val ) { if( $val != '0' && $val != '1' ) { - if( $_POST['blogfunction'] == 'delete' ) { + if ( isset($_POST['allblog_delete']) ) { + $blogfunction = 'all_delete'; wpmu_delete_blog( $val, true ); - } elseif( $_POST['blogfunction'] == 'spam' ) { + } elseif ( isset($_POST['allblog_spam']) ) { + $blogfunction = 'all_spam'; update_blog_status( $val, "spam", '1', 0 ); set_time_limit(60); + } elseif ( isset($_POST['allblog_notspam']) ) { + $blogfunction = 'all_notspam'; + update_blog_status( $val, "spam", '0', 0 ); + set_time_limit(60); } } } - wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'all_'.$_POST['blogfunction']), $_SERVER['HTTP_REFERER'] ) ); + wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $blogfunction), $_SERVER['HTTP_REFERER'] ) ); exit(); break; @@ -386,16 +392,20 @@ switch( $_GET['action'] ) { foreach ( (array) $_POST['allusers'] as $key => $val ) { if( $val != '' && $val != '0' && $val != '1' ) { $user_details = get_userdata( $val ); - if( $_POST['userfunction'] == 'delete' ) { + if ( isset($_POST['alluser_delete']) ) { wpmu_delete_user($val); - } elseif( $_POST['userfunction'] == 'spam' ) { + $userfunction = 'all_delete'; + } elseif ( isset($_POST['alluser_spam']) ) { + $userfunction = 'all_spam'; $blogs = get_blogs_of_user( $val, true ); foreach ( (array) $blogs as $key => $details ) { + if ( $details->userblog_id == 1 ) { continue; } // main blog not a spam ! update_blog_status( $details->userblog_id, "spam", '1' ); do_action( "make_spam_blog", $details->userblog_id ); } update_user_status( $val, "spam", '1', 1 ); - } elseif ( $_POST[ 'userfunction' ] == 'notspam' ) { + } elseif ( isset($_POST['alluser_notspam']) ) { + $userfunction = 'all_notspam'; $blogs = get_blogs_of_user( $val, true ); foreach ( (array) $blogs as $key => $details ) { update_blog_status( $details->userblog_id, "spam", '0' ); @@ -404,7 +414,7 @@ switch( $_GET['action'] ) { } } } - wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'all_'.$_POST['userfunction']), $_SERVER['HTTP_REFERER'] ) ); + wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $userfunction), $_SERVER['HTTP_REFERER'] ) ); exit(); break; diff --git a/wp-admin/wpmu-options.php b/wp-admin/wpmu-options.php index fb8d897..ce539a5 100644 --- a/wp-admin/wpmu-options.php +++ b/wp-admin/wpmu-options.php @@ -21,181 +21,170 @@ if (isset($_GET['updated'])) {
-
- (These settings cannot be modified by blog owners)') ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- domain ); ?> -
-
-
-
-
- -
- />
- />
- -
- -
- -
- -
- -
- " size="45" /> -
- -
- " size="45" /> -
- -
- -
- -
MB
KB
-
+

(These settings cannot be modified by blog owners)') ?>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ domain ); ?> +
+
+
+
+
+ +
+ />
+ />
+ +
+ +
+ +
+ +
+ +
+ " size="45" /> +
+ +
+ " size="45" /> +
+ +
+ +
+ +
MB
KB
-
- - +

+
+ + + + +
+ +
+ +
+ +

(These settings may be overridden by blog owners)') ?>

+ + - + + + -
- -
- -
-
- -
- (These settings may be overridden by blog owners)') ?> - - - - - - -
- -
-
+ } // languages + ?> + -
- (Enable or disable WP Backend Menus)') ?> - - - - - - $val ) { - $checked = ( $menu_perms[$val] == '1' ) ? ' checked="checked"' : ''; - echo ""; - } - ?> -
" . ucfirst( $val ) . "
-
+

(Enable or disable WP Backend Menus)') ?>

+ + + + + + $val ) { + $checked = ( $menu_perms[$val] == '1' ) ? ' checked="checked"' : ''; + echo ""; + } + ?> +
" . ucfirst( $val ) . "
- +

diff --git a/wp-admin/wpmu-themes.php b/wp-admin/wpmu-themes.php index 512b7bb..a6a566c 100644 --- a/wp-admin/wpmu-themes.php +++ b/wp-admin/wpmu-themes.php @@ -22,28 +22,29 @@ $allowed_themes = get_site_allowed_themes();

- +
- - - - - + + + + + - + $theme ) : $theme_key = wp_specialchars($theme['Stylesheet']); - $class = ('alternate' == $class) ? '' : 'alternate'; - $enabled = $disabled = ''; + $class = ('alt' == $class) ? '' : 'alt'; + $class1 = $enabled = $disabled = ''; if( isset( $allowed_themes[ $theme_key ] ) == true ) { $enabled = 'checked="checked" '; + $class1 = ' active'; } else { $disabled = 'checked="checked" '; } ?> - +
    diff --git a/wp-admin/wpmu-upgrade-site.php b/wp-admin/wpmu-upgrade-site.php index 2d426b0..8a77113 100644 --- a/wp-admin/wpmu-upgrade-site.php +++ b/wp-admin/wpmu-upgrade-site.php @@ -43,7 +43,7 @@ switch( $_GET['action'] ) { } echo ""; ?> -

+

+
+ + +

+ - + 'display name' + $posts_columns = array( + 'checkbox' => '', + 'id' => __('ID'), + 'login' => __('Login'), + 'email' => __('Email'), + 'name' => __('Name'), + 'registered' => __('Registered'), + 'blogs' => '' + ); + $posts_columns = apply_filters('manage_posts_columns', $posts_columns); + ?> - $column_display_name) { ?> - + $column_display_name) { + if( $column_id == 'blogs' ) { + echo ''; + } elseif( $column_id == 'checkbox') { + echo ''; + } else { ?> + + - + $column_display_name) : switch($column_name) { - case 'id': ?> - + case 'checkbox': ?> + + + - + case 'login': + $edit = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=".$user['ID'] ) ); + ?> + - - - -
- - apage="> - - '.__('Blogs').'apage=">
' name='allusers[]' value='' /> ' name='allusers[]' value='' /> &id=&redirect=" class="delete" onclick="return deleteSomething( 'user', , '' );">
- -
- $user_navigation

"; ?> -
- -

- -

-
    -
  • -
  • -
  • -
- -

- - - ' />

@@ -273,23 +226,24 @@ if ( $_GET['updated'] == 'true' ) { if( apply_filters('show_adduser_fields', true) ) : ?>
+

-

- - - - - - - - - - - -
-

- -

+ + + + + + + + + + + + +
+

+ +

diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index e7f3fe0..7c72ba0 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -1774,19 +1774,30 @@ add_filter( 'term_id_filter', 'global_terms', 10, 2 ); // taxonomy specific filt function choose_primary_blog() { global $current_user; - echo __('Primary Blog:') . ' '; - $all_blogs = get_blogs_of_user( $current_user->ID ); - if( count( $all_blogs ) > 1 ) { - $primary_blog = get_usermeta($current_user->ID, 'primary_blog'); + ?> + + + + +
+ ID ); + if( count( $all_blogs ) > 1 ) { + $primary_blog = get_usermeta($current_user->ID, 'primary_blog'); + ?> + + -

+
+