miniBB ®

miniBB

®
Support Forums
  
 · Start · Sign in · 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:39Reply Quote
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 Lead Developer
#2 · Posted: 6 Nov 2006 07:21Reply Quote
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:44Reply Quote
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 Lead Developer
#4 · Posted: 6 Nov 2006 09:51Reply Quote
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:46Reply Quote
hmm, it gives me 0 results too. good feature, though.

Author tobyy
Partaker
#6 · Posted: 6 Nov 2006 11:54Reply Quote
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 Lead Developer
#7 · Posted: 6 Nov 2006 12:59Reply Quote
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:19Reply Quote
works! is it possible to do this for members list addon?

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

Author tobyy
Partaker
#10 · Posted: 7 Nov 2006 06:55Reply Quote
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

BB code for the Bold StyleBB code for the Italic StyleBB Code for the PictureBB code for the URLUpload a File

  ?
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 File and Picture Attachments add-on: extend your miniBB-forums, attaching images and files.