phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Search in User Profiles mod


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
lhna
Board Member



Joined: 20 Jul 2011

Posts: 3



PostPosted: Wed Jul 20, 2011 10:03 pm 
Post subject: Search in User Profiles mod

I have the "Search in User Profiles" mod installed on our phpBB2 board, but it doesn't work quite the way I hoped it would. I'm using it for a non-profit community association, and I want users to be able to lookup other users (residents) in the neighborhood by street address.

However, if you type "123 main" in the search box, instead of getting the users at 123 main street, you get every user with "123" in their profile AND every user with "main" in their profile. Unlike the Keyword search, this mod does not have an option for "search for any terms" or "search for all terms".

I bet there's a way to hack the mod so the boolean operator is "and" instead of "or", but I'm not savvy enough to figure it out. Any ideas?

thanks,
Mike
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 414
Location: Québec


flag
PostPosted: Thu Jul 21, 2011 1:14 am 
Post subject: Re: Search in User Profiles mod

This is a bit tougher than what I'm used to, so I'll have you try something but I can't guarantee it will work right away.

Open search.php
FIND
Code:
$split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ?  split_words(clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords);

REPLACE WITH
Code:
$split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ?  clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array) : $search_keywords;


I'll be honest, I don't understand everything that's going on in the code, but hopefully that will do!
Back to top
lhna
Board Member



Joined: 20 Jul 2011

Posts: 3



PostPosted: Thu Jul 21, 2011 2:29 am 
Post subject: Re: Search in User Profiles mod

Thanks for the suggestion, but that broke it. Gave me an invalid argument error.
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 414
Location: Québec


flag
PostPosted: Thu Jul 21, 2011 3:56 am 
Post subject: Re: Search in User Profiles mod

Hm, it's probably expecting an array for $split_search / $search_keywords...

Try to replace with this:
Code:
$split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ?  clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array) : array($search_keywords);


And if it still doesn't work I don't think I can do much more for you, sorry icon_confused.gif
Back to top
lhna
Board Member



Joined: 20 Jul 2011

Posts: 3



PostPosted: Thu Jul 21, 2011 4:52 am 
Post subject: Re: Search in User Profiles mod

Darn, that broke it too, got this message:

Quote:
Warning: Invalid argument supplied for foreach() in /home2/user/public_html/search.php on line 1387


Oh well, thanks for the ideas, I wouldn't have any idea where to start.

Anyone else lurking out there with an idea?
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0169 seconds using 15 queries. (SQL 0.0013 Parse 0.0005 Other 0.0151)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo