1
0
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:
Suhaib Khan
2014-02-21 13:01:22 +05:30
committed by Cesar G
parent b5ee81dae6
commit dd07efcac7
4 changed files with 33 additions and 50 deletions

View File

@@ -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;