I have this ajax code, it returns the usernames only, example:
mokujin, kh99
Now what I need to do to return with userids:
mokujin, kh99
PHP Code:
if ($_POST['do'] == 'users')
{
$vbulletin->input->clean_array_gpc('p', array('p' => UINT));
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_group('users');
$users = $db->query_read_slave("
SELECT user.userid, user.username FROM " . TABLE_PREFIX . "user
AS user WHERE username LIKE('" . $db->escape_string_like(mok) . "%')
ORDER BY username
LIMIT 15
");
while ($user = $db->fetch_array($users))
{
$xml->add_tag('user', $user['username'], array('userid' => $user['userid']));
}
$xml->close_group();
$xml->print_xml();
}
And my template mokujin_users_bit:
HTML Code:
<a href="member.php?u={vb:raw mokusers.userid}">{vb:raw mokusers.username}</a>
I want to fetch usernames into my template!
Please! Thank youuuuuu!!!!