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 strings

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

Joined: 04 Jun 2011

Posts: 35

PostPosted: Sun Jun 05, 2011 12:08 am 
Post subject: search strings

While experimenting with search strings, i discovered some very annoying things.

Some search parameters work when they are used in browser while some others work only via the submit form of search.php

for example


will work just fine, but if you add another parameter in the string


it will ignore the last parameter. Is this true? Some parameters only work via the search.php submit form?

What i am trying to accomplish is to create search strings using [search] bbcode inside posts, something like a pseudo tagging system. The string i want to trigger is this:


where i noticed that the "search_fields=titleonly" and the "how_results=topics" are ignored. For searching in titles only i am using the smartor mod, like all most v2 forums.

my bbcode.tpl string is this

<!-- BEGIN search --><a href="search.php?search_keywords={KEYWORD}&amp;search_terms=all&amp;search_fields=titleonly&amp;show_results=topics"/>{KEYWORD}</a><!-- END search -->

And the question is: How can i make all the search.php parameters to work as an URL search string?

i apologise for my poor english, hope i make sense...
Back to top
Board Member

Joined: 19 Feb 2009

Posts: 434
Location: Qu├ębec

PostPosted: Sun Jun 05, 2011 4:52 am 
Post subject: Re: search strings

Yeah, for some reason they're only taken as POST vars. There's probably a reason for this but I don't know much about the search engine and can't really look into it. Basically you'll need to edit around lines 72 and 84 in search.php so they look more like 60+.

For instance, change
$show_results = ( isset($HTTP_POST_VARS['show_results']) ) ? $HTTP_POST_VARS['show_results'] : 'posts';
$show_results = ($show_results == 'topics') ? 'topics' : 'posts';

if ( isset($HTTP_POST_VARS['show_results']) || isset($HTTP_GET_VARS['show_results']))
   $show_results = ( isset($HTTP_POST_VARS['show_results']) ) ? $HTTP_POST_VARS['show_results'] : $HTTP_GET_VARS['show_results'];
$show_results = ($show_results == 'topics') ? 'topics' : 'posts';

And the other one in its default state would be this, but you'll have to edit it to accommodate your Smartor mod.
if ( isset($HTTP_POST_VARS['search_fields']) || isset($HTTP_GET_VARS['search_fields']))
   $search_fields = ( isset($HTTP_POST_VARS['search_fields']) ) ? $HTTP_POST_VARS['search_fields'] : $HTTP_GET_VARS['search_fields'];
$search_fields = ($search_fields == 'all' ) ? 1 : 0;

Take note that I'm bloody tired so I just put that together quickly to point you in the right direction.
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.0262 seconds using 15 queries. (SQL 0.0023 Parse 0.0008 Other 0.0231)
phpBB Customizations by the
Template Design by DeLFlo and Moments of Light Logo