diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/memberlist.php | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index c23a409ae7..759a899de1 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1231,21 +1231,19 @@ switch ($mode) ); extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_sql_query_data', compact($vars))); - // Count the users ... - if ($sql_where) - { - $sql = 'SELECT COUNT(u.user_id) AS total_users - FROM ' . USERS_TABLE . " u$sql_from - WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ") - $sql_where"; - $result = $db->sql_query($sql); - $total_users = (int) $db->sql_fetchfield('total_users'); - $db->sql_freeresult($result); - } - else + $user_types = array(USER_NORMAL, USER_FOUNDER); + if ($auth->acl_get('a_user')) { - $total_users = $config['num_users']; + $user_types[] = USER_INACTIVE; } + // Count the users ... + $sql = 'SELECT COUNT(u.user_id) AS total_users + FROM ' . USERS_TABLE . " u$sql_from + WHERE " . $db->sql_in_set('u.user_type', $user_types) . " + $sql_where"; + $result = $db->sql_query($sql); + $total_users = (int) $db->sql_fetchfield('total_users'); + $db->sql_freeresult($result); // Build a relevant pagination_url $params = $sort_params = array(); @@ -1411,13 +1409,7 @@ switch ($mode) ); } - $user_types = array(USER_NORMAL, USER_FOUNDER); - if ($auth->acl_get('a_user')) - { - $user_types[] = USER_INACTIVE; - } - - $start = $pagination->validate_start($start, $config['topics_per_page'], $config['num_users']); + $start = $pagination->validate_start($start, $config['topics_per_page'], $total_users); // Get us some users :D $sql = "SELECT u.user_id |