Topic: User search

I added some fields to user profile and I'd like the user search feature to search the username and another field. If a match is found in either one then it shows up.

In the userlist.php file, I think the line to change is the one below. I need to make it an 'OR' statement and add the code for the other field. How do I do this?

   

$where_sql[] = 'u.username '.$like_command.' \''.$db->escape(str_replace('*', '%', $username)).'\'';

Re: User search

I'm not a programmer but I think my solution goes something like this. I added code to the end of the original WHERE statement (see above). I simply want to search two fields instead of one. Can one of you php programmers tell me if this is correct syntax?

$where_sql[] = 'u.username '.$like_command.' \''.$db->escape(str_replace('*', '%', $username)).'\'' OR 'u.newfield '.$like_command.' \''.$db->escape(str_replace('*', '%', $username)).'\'';

Re: User search

Hey I was right. Thanks to me for helping out.