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
Registered
#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 | 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

$whatx,'=',$whatus

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

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

Author tobyy
Registered
#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
Registered
#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 | 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
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
Registered
#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:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


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