mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-03 14:17:56 +02:00
[ticket/10737] Clean up memberlist.php.
PHPBB3-10737
This commit is contained in:
parent
652f787abd
commit
1a51ceeabe
@ -982,23 +982,31 @@ switch ($mode)
|
||||
break;
|
||||
|
||||
case 'livesearch':
|
||||
$username_chars = $request->variable('q', '', true);
|
||||
$username_chars = utf8_strtolower($username_chars);
|
||||
|
||||
$sql = 'SELECT username, user_id
|
||||
$username_chars = $request->variable('username', '', true);
|
||||
|
||||
$sql = 'SELECT username, user_id, user_colour
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('user_type', array(USER_NORMAL, USER_FOUNDER)) . '
|
||||
AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->any_char);
|
||||
$result = $db->sql_query_limit($sql, 10);
|
||||
|
||||
$user_list = array();
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$user_list[] = array('id' => $row['user_id'], 'name' => $row['username']);
|
||||
$user_list[] = array(
|
||||
'user_id' => (int) $row['user_id'],
|
||||
'username' => $row['username'],
|
||||
'result' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
$json_response = new \phpbb\json_response();
|
||||
$json_response->send($user_list);
|
||||
$json_response->send(array(
|
||||
'keyword' => $username_chars,
|
||||
'results' => $user_list,
|
||||
));
|
||||
|
||||
break;
|
||||
|
||||
case 'group':
|
||||
@ -1638,6 +1646,7 @@ switch ($mode)
|
||||
|
||||
'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser' . (($start) ? "&start=$start" : '') . (!empty($params) ? '&' . implode('&', $params) : '')) : '',
|
||||
'U_HIDE_FIND_MEMBER' => ($mode == 'searchuser' || ($mode == '' && $submit)) ? $u_hide_find_member : '',
|
||||
'U_LIVE_SEARCH' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=livesearch'),
|
||||
'U_SORT_USERNAME' => $sort_url . '&sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_JOINED' => $sort_url . '&sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_POSTS' => $sort_url . '&sk=d&sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user