15 years on The Web
miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
How To miniBB Support Forums / How To /   

How to search for usernames using a placeholder?

Author tobyy
#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..

Author Paul
Lead Developer
#2 | Posted: 6 Nov 2006 07:21 | Edited by: Paul 
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


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

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

Author tobyy
#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
#5 | Posted: 6 Nov 2006 10:46 
hmm, it gives me 0 results too. good feature, though.

Author tobyy
#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 Skinner

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

Author Paul
Lead Developer
#7 | Posted: 6 Nov 2006 12:59 | Edited by: Paul 
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
#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
#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? Top

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

 Short link for this topic:

You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB