MyBB Community Forums

Full Version: Set the default search to title only
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I like to set the default search to title only.

1. Search in title by default with quick search
2. Check automatically the title only in adcandec search

For 2 : i can do it via theme
But for 1 i didn't find how to do this ?

I see the event search_do_search_start , but no way to set default search since it get by
"postthread" => $mybb->get_input('postthread', MyBB::INPUT_INT),
Any idea ?

Sorry …

header_quicksearch :
<input type="hidden" name="postthread" value="2" />
Deleted.
Dev not required for this. He answered his own question.

For a more detailed explanation:

postthread is a radio toggle in the advanced search form controlled by the search template. Value=1 for searching the post, Value=2 for searching the thread title. The default value is controlled by checked="checked".

<span class="smalltext"><input type="radio" class="radio" name="postthread" value="1" checked="checked" />{$lang->search_entire_post}<br /><input type="radio" class="radio" name="postthread" value="2" />{$lang->search_titles_only}</span></td>

The header_quicksearch template sets the default value of postthread to 1 for searching posts. He changed it to 2 for searching titles.