mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-22 08:13:14 +02:00
[ticket/10737] Using JQuery events and JSON response.
PHPBB3-10737
This commit is contained in:
@@ -983,7 +983,6 @@ switch ($mode)
|
||||
|
||||
case 'livesearch':
|
||||
$username_chars = $request->variable('q', '', true);
|
||||
$hint = "";
|
||||
|
||||
$sql = 'SELECT username, user_id
|
||||
FROM ' . USERS_TABLE . '
|
||||
@@ -991,17 +990,17 @@ switch ($mode)
|
||||
AND username ' . $db->sql_like_expression($username_chars . $db->any_char);
|
||||
$result = $db->sql_query_limit($sql, 10);
|
||||
|
||||
$user_list = array();
|
||||
$i = 1;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$j = ($i%2)+1;
|
||||
$hint.= "<tr class='bg".$j." row".$j."'><td><a href='" .
|
||||
$phpbb_root_path."memberlist.$phpEx". "?mode=viewprofile&u=" . $row['user_id'] .
|
||||
"' target='_blank'>" .
|
||||
$row['username'] . "</a></td></tr>";
|
||||
$user_list[] = array("id" => $row['user_id'], "name" => $row['username']);
|
||||
$i++;
|
||||
}
|
||||
echo $hint;
|
||||
|
||||
$json_response = new \phpbb\json_response();
|
||||
echo $json_response->send($user_list);
|
||||
exit();
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user