Remove pseudo role group by

git-svn-id: http://svn.automattic.com/wordpress/trunk@6886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-02-17 20:16:22 +00:00
parent fbf440b88b
commit 20e180de64
2 changed files with 13 additions and 19 deletions

View File

@ -291,10 +291,11 @@ class WP_User_Search {
var $page;
var $role;
var $raw_page;
var $users_per_page = 50;
var $users_per_page = 2;
var $first_user;
var $last_user;
var $query_limit;
var $query_sort;
var $query_from_where;
var $total_users_for_query = 0;
var $too_many_total_users = false;
@ -315,7 +316,8 @@ class WP_User_Search {
function prepare_query() {
global $wpdb;
$this->first_user = ($this->page - 1) * $this->users_per_page;
$this->query_limit = 'LIMIT ' . $this->first_user . ',' . $this->users_per_page;
$this->query_limit = ' LIMIT ' . $this->first_user . ',' . $this->users_per_page;
$this->query_sort = ' ORDER BY user_login';
$search_sql = '';
if ( $this->search_term ) {
$searches = array();
@ -337,7 +339,7 @@ class WP_User_Search {
function query() {
global $wpdb;
$this->results = $wpdb->get_col('SELECT ID ' . $this->query_from_where . $this->query_limit);
$this->results = $wpdb->get_col('SELECT ID ' . $this->query_from_where . $this->query_sort . $this->query_limit);
if ( $this->results )
$this->total_users_for_query = $wpdb->get_var('SELECT COUNT(ID) ' . $this->query_from_where); // no limit

View File

@ -185,14 +185,6 @@ default:
// Query the users
$wp_user_search = new WP_User_Search($_GET['usersearch'], $_GET['userspage'], $_GET['role']);
// Make the user objects
foreach ( $wp_user_search->get_results() as $userid ) {
$tmp_user = new WP_User($userid);
$roles = $tmp_user->roles;
$role = array_shift($roles);
$roleclasses[$role][$tmp_user->user_login] = $tmp_user;
}
if ( isset($_GET['update']) ) :
switch($_GET['update']) {
case 'del':
@ -260,6 +252,7 @@ foreach ( (array) $users_of_blog as $b_user ) {
$avail_roles[$b_role]++;
}
}
unset($users_of_blog);
foreach ( $wp_roles->get_names() as $role => $name ) {
if ( !isset($avail_roles[$role]) )
@ -333,20 +326,19 @@ unset($role_links);
<th><?php _e('Posts') ?></th>
</tr>
</tbody>
<tbody id="users" class="list:user user-list">
<?php
foreach ($roleclasses as $role => $roleclass) {
uksort($roleclass, "strnatcasecmp");
?>
<tbody id="role-<?php echo $role; ?>" class="list:user user-list"><?php
$style = '';
foreach ( (array) $roleclass as $user_object ) {
foreach ( $wp_user_search->get_results() as $userid ) {
$user_object = new WP_User($userid);
$roles = $user->roles;
$role = array_shift($roles);
$style = '';
$style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
echo "\n\t" . user_row($user_object, $style, $role);
}
?>
</tbody>
<?php } ?>
</table>
<br style="clear:both;" />