miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
How To miniBB Support Forums / How To /  
 

How to search for usernames using a placeholder?

 
Author tobyy
Partaker
#1 | Posted: 6 Nov 2006 06:39 
Is there a possibility to search for a user using a placeholder? (in the Admin section)

example: my search "Mike%" should get these results:

Mike Skinner
Mike Jackson
Mike Jordan
...


hope there is a way to do that..
thanx
tobyy

Author Paul
Lead Developer 
#2 | Posted: 6 Nov 2006 07:21 
If you modify bb_admin.php and locate the section

elseif ($searchus=='email' OR $searchus=='login'){

there will be an SQL request with a condition

$whatx,'=',$whatus

so you will need to modify it a bit...

$whatx,' like ', '%'.$whatus.'%'

Author tobyy
Partaker
#3 | Posted: 6 Nov 2006 09:44 
seems like that doesn't work... i always get 0 results..

here's the whole line:

if($row=db_simpleSelect(0,$Tu,$dbUserId.','.$dbUserSheme['username'][1 ].','.$dbUserDate.','.$dbUserSheme['user_password'][1].','.$dbUserShem e['user_email'][1],$whatx,'like',$whatus.'%')){



what could be wrong?

Author Paul
Lead Developer 
#4 | Posted: 6 Nov 2006 09:51 
Forgot to mention - you should search, not entering '%' sign in the search term itself. If you modify the code, it will find the names automatically by a fragment... If you enter 'Mike', it will find 'Mike Skinner', 'Mike Jackson',
'Mike Jordan'.

I often need this myself and probably will implement something like this in the next releases.

Author Anonymous
Guest
#5 | Posted: 6 Nov 2006 10:46 
hmm, it gives me 0 results too. good feature, though.

Author tobyy
Partaker
#6 | Posted: 6 Nov 2006 11:54 
i always get 0 results... any idea what could be wrong? i searched for users i know that they exist...

mike
Mike
Mike Skinner

none of these search terms would work... :(

Author Paul
Lead Developer 
#7 | Posted: 6 Nov 2006 12:59 
Oh well, sorry. 'like' should contain spaces on both side. I've fixed the code above, try again. It works 100% on my side.

Author Anonymous
Guest
#8 | Posted: 6 Nov 2006 13:19 
works! is it possible to do this for members list addon?

Author Paul
Lead Developer 
#9 | Posted: 6 Nov 2006 16:20 
Well, I'll think about it :-)

Author tobyy
Partaker
#10 | Posted: 7 Nov 2006 06:55 
works great.. thank you very much.

How To miniBB Support Forums / How To /
 How to search for usernames using a placeholder?
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑