MyBB Community Forums

Full Version: xmlhttp get_users function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This function should return uid too.

There you go ->
Line 226 and onwards:

$query = $db->simple_select("users", "uid, username", "username LIKE '".$db->escape_string_like($mybb->input['query'])."%'", $query_options);
 if($limit == 1)
{
$user = $db->fetch_array($query);
$user['username'] = htmlspecialchars_uni($user['username']);
$data = array('id' => $user['username'], 'text' => $user['username'], 'uid' => $user['uid']);
}
else
{
$data = array();
while($user = $db->fetch_array($query))
{
$user['username'] = htmlspecialchars_uni($user['username']);
$data[] = array('id' => $user['username'], 'text' => $user['username'], 'uid' => $user['uid']);
}
}
Not that I disagree, since we could enhance the function without nearly any additional overhead (UID is already selected for some reason), but in what way exactly is this a bug? What kind of problem(s) does the lack of returning UID cause?
(2015-06-15, 03:01 PM)Destroy666 Wrote: [ -> ]Not that I disagree, since we could enhance the function without nearly any additional overhead, but in what way exactly is this a bug? What kind of problem(s) does the lack of returning UID cause?

for me, it did, until i re-wrote it.

I created a mention system, and I Wanted to implment auto complete for that. So if any body types in @Ced a pop-up will apear containing matches and when a match is chosen, the name gets converted to uid, @666 

So i needed uid..... 

This will help developers.

and yea... not a bug.
Moving to Suggestions then. If noone has anything against it, I'll add it here: https://github.com/mybb/mybb/issues/1653 But you can use the hook in xmlhttp.php to do the same.
Okay.