Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vbulletin member autocomplete @mention #590

Open
mizah54 opened this issue Dec 9, 2020 · 0 comments
Open

vbulletin member autocomplete @mention #590

mizah54 opened this issue Dec 9, 2020 · 0 comments

Comments

@mizah54
Copy link

mizah54 commented Dec 9, 2020

http://ichord.github.io/At.js/

How can I do the following vbulletin user search code with at.js? How should the application be to show textarea as @exampleuser
$ .ajax ({ type: "POST", url: 'ajax.php?do =usersearch',

I tried it as it did not happen

if ($_POST['do'] == 'usersearch')
{
$vbulletin->input->clean_array_gpc('p', array('fragment' => TYPE_STR));

$vbulletin->GPC['fragment'] = convert_urlencoded_unicode($vbulletin->GPC['fragment']);

if ($vbulletin->GPC['fragment'] != '' AND strlen($vbulletin->GPC['fragment']) >= 3)
{
    $fragment = htmlspecialchars_uni($vbulletin->GPC['fragment']);
}
else
{
    $fragment = '';
}

$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_group('users');

if ($fragment != '')
{
    $users = $db->query_read_slave("
        SELECT userid, username FROM " . TABLE_PREFIX . "user
        WHERE username LIKE('" . $db->escape_string_like($fragment) . "%')
        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();

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant