ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > SMF Forum Mods

DC SMF Search Mod - an improvement search for smf forum (codename Zillarank)

<< < (8/11) > >>

TjaMe:
Thanks a million 'zilla, your search mod is awesome! :D

I was trying to improve on the standard search myself, but got lost somewhere in between regexps & sql statements... I'm well impressed with what you've done in such a short period of time! More than well impressed, actually!  :D


I just couldn't resist modifying some of your code: I changed the following:



--- Code: PHP ---if (!isset($search_params['match_mode']))                $search_params['match_mode'] = empty($_REQUEST['match_mode']) ? 'smart' : $_REQUEST['match_mode'];                        if (!empty($search_params['match_mode']))                {                        switch ($search_params['match_mode']) {                        case 'whole':                            break;                        case 'smart':                            break;                        case 'any':                            break;                        default:                                $search_params['match_mode'] = 'smart';                            break;                        }                }        else                $search_params['match_mode'] = 'smart';
to:


--- Code: PHP ---if (!isset($search_params['match_mode']))                $search_params['match_mode'] = $_REQUEST['match_mode'];                        switch ($search_params['match_mode']) {                case 'whole':                case 'smart':                case 'any':                        break;                default:                        $search_params['match_mode'] = 'smart';        }
then copied it to PlusSearch1. It took me a while to notice that $context['search_params']['match_mode'] != $search_params['match_mode']

... maybe I should have resisted the temptation...  ;D

Thanks again for such a superb search engine. I seriously hope all the smf community try out your mod and realize what they've been missing all these years.

Credit where it's due. Wordzilla, you're a scholar & a gentleman, and I salute you, sir!

Wordzilla:

--- Code: PHP ---if (!isset($search_params['match_mode']))                $search_params['match_mode'] = $_REQUEST['match_mode'];                        switch ($search_params['match_mode']) {                case 'whole':                case 'smart':                case 'any':                        break;                default:                        $search_params['match_mode'] = 'smart';        }
Your code does look v neat, thanks for sharing.  :Thmbsup:

I have a question, thou:

What if $_REQUEST['match_mode'] isn't set (undefined index) before usage? Doesn't it generate a warning in forum log?


--- Code: PHP ---if (!isset($search_params['match_mode']))                $search_params['match_mode'] = $_REQUEST['match_mode'];


I'm so happy it's working for you TjaMe!  :Thmbsup:

Care to post us the url to your forum here?  :)

TjaMe:
Ooops! :-[ You're absolutely right about the warning on the forum log!

I was in 'trim lines mode' & got carried away...   

:-\ I suppose that


--- Code: PHP ---if (!isset($search_params['match_mode']))    $search_params['match_mode'] = empty($_REQUEST['match_mode']) ? '' : $_REQUEST['match_mode'];
is the smallest that snippet can ever get without generating a warning.

Drats!  :o

Our forum is behind a firewall on an intranet & deals with very, very boring stuff, but if we ever have a public side to it I'll post the url, I promise!

Thank you again for sharing your really excellent code!  :D

Wordzilla:
Just uploaded the latest mod 1.1.1

Cleaned up code. Minor bug fixes. Added no single character search. Thanks to Aaron: http://custom.simplemachines.org/mods/index.php?mod=884
--- End quote ---

Folks at SMF carefully reviewed the mod and offered me some constructive ideas yesterday, now the new mod is in better compliance with SMF coding guidelines. Hopefully it will be officially approved by SMF very soon.


To upgrade from an earlier version:
   1. go to the package manager and UNINSTALL previous version
   2. Upload new package zip
   3. install new version

cranioscopical:
Folks at SMF carefully reviewed the mod and offered me some constructive ideas yesterday, now the new mod is in better compliance with SMF coding guidelines. Hopefully it will be officially approved by SMF very soon.
--- End quote ---

A glimmer of intelligence at the end of the tunnel?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version