2012-08-15, 11:31 PM
2012-08-15, 11:47 PM
Thanks for the reply Omar
I've tried this:
But unfortunately it's still not working.
Thanks again
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"});
// -->
</script>
<input type="text" class="textbox" name="username" id="username" value="" />
But unfortunately it's still not working.
Thanks again
2012-08-16, 12:54 AM
Please post the output code source, ask asked in my previous posts. Also, where are you trying to use this? In the ACP?
2012-08-16, 11:26 AM
Yeah, I'm trying to use this in ACP.
Here's some of the outputted code:
Thanks
Here's some of the outputted code:
<div class="nav_tabs"> <ul>
<li class=""><a href="index.php?module=tools-easyrep&action=addpositive">Add Positive Reputation</a></li>
<li class=""><a href="index.php?module=tools-easyrep&action=addneutral">Add Neutral Reputation</a></li>
<li class=" active"><a href="index.php?module=tools-easyrep&action=addnegative">Add Negative Reputation</a></li>
</ul>
<div class="tab_description">Add Negative Reputation To Users.</div>
</div><form action="index.php?module=tools-easyrep&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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- 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"});
// -->
</script>
<input type="text" class="textbox" name="username" id="username" value="" />
<!-- end: testinggggg --><div class="border_wrapper">
Thanks
2012-08-16, 06:33 PM
You can heck the how the search box in the users page work then.
2012-08-16, 07:01 PM
Got that working in ACP now, thanks Omar!
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
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
2012-08-16, 07:11 PM
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:
This is what I do in my awards plugin.
$query = $db->simple_select('users', '*', "LOWER(username)='{$db->escape_string($mybb->input['username'])}'", array('limit' => 1));
$user = $db->fetch_array($query);
if(!$user['uid'])
{
// show error
}
// there was a user so continue the code
This is what I do in my awards plugin.
2012-08-16, 07:15 PM
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:
it doesn't. Am I missing something for this?
Thanks again
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
2012-08-16, 07:57 PM
It seems right to me. What is the output source code?
2012-08-16, 08:02 PM
<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">
<tbody>
<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>
</td>
</tr>
Thanks Omar