MyBB Community Forums

Full Version: "Enter Usergroup IDs, seperated by a comma"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Are you using templates in the ACP? Try removing the "if(use_xmlhttprequest == "1"" part of the code.
Thanks for the reply Omar

I've tried this:

<script type="text/javascript" src="{$settings['bburl']}/jscripts/autocomplete.js?ver=1600"></script>
<script type="text/javascript">
        new autoComplete("username", "{$settings['bburl']}/xmlhttp.php?action=get_users", {valueSpan: "username"});
// -->
<input type="text" class="textbox" name="username" id="username" value="" />

But unfortunately it's still not working.

Thanks again Smile
Please post the output code source, ask asked in my previous posts. Also, where are you trying to use this? In the ACP?
Yeah, I'm trying to use this in ACP.

Here's some of the outputted code:
<div class="nav_tabs">	<ul>
		<li class=""><a href="index.php?module=tools-easyrep&amp;action=addpositive">Add Positive Reputation</a></li>
		<li class=""><a href="index.php?module=tools-easyrep&amp;action=addneutral">Add Neutral Reputation</a></li>
		<li class=" active"><a href="index.php?module=tools-easyrep&amp;action=addnegative">Add Negative Reputation</a></li>
	<div class="tab_description">Add Negative Reputation To Users.</div>
</div><form action="index.php?module=tools-easyrep&amp;action=addnegative" method="post" id="easyrep">
<input type="hidden" name="my_post_key" value="1c20bdbfec64de05444388cab4efd119" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<!-- start: testinggggg -->
<script type="text/javascript" src="http://localhost/mybb/jscripts/autocomplete.js?ver=1600"></script>
<script type="text/javascript">
        new autoComplete("username", "http://localhost/mybb/xmlhttp.php?action=get_users", {valueSpan: "username"});
// -->
<input type="text" class="textbox" name="username" id="username" value="" />
<!-- end: testinggggg --><div class="border_wrapper">

Thanks Smile
You can heck the how the search box in the users page work then.
Got that working in ACP now, thanks Omar! Smile

How would I go about finding there UID from this? For example, If I searched for the username "Vernier" how could I find the uid of that?

Thanks again, much appreciated Smile
You can include the functions_user.php file and make ufe of one function in that file to get a user by username, or simply write yours:
$query = $db->simple_select('users', '*', "LOWER(username)='{$db->escape_string($mybb->input['username'])}'", array('limit' => 1));
$user = $db->fetch_array($query);
// show error
// there was a user so continue the code

This is what I do in my awards plugin.
Ok thanks Omar.

When I tried the username autocomplete with a standard textarea (<textarea id="negative_rec_uid"></textarea>) it seemed to work, however when I use this:
$negativeform_container->output_row($lang->negative_rep_to_which_uid, "", $negativeform->generate_text_box('negative_rec_uid', '', array('id' => 'negative_rec_uid')), 'negative_rec_uid');

it doesn't. Am I missing something for this?

Thanks again Smile
It seems right to me. What is the output source code?
	<script type="text/javascript" src="../jscripts/autocomplete.js?ver=140"></script>
	<script type="text/javascript">
		new autoComplete("negative_rec_uid", "../xmlhttp.php?action=get_users", {valueSpan: "username"});
	// -->
	</script><div class="border_wrapper">
	<div class="title">Easy Rep</div>
<table class="general form_container " cellspacing="0">
		<tr class="first">
			<td class="first"><label for="negative_rec_uid"><font color='red'>*</font> Add Negative Reputation To Which UID?:</label>
<div class="description">negative_rec_uid</div>
<div class="form_row"><input type="text" name="negative_rec_uid" value="" class="text_input" id="negative_rec_uid" /></div>

Thanks Omar Smile
Pages: 1 2 3 4 5