MyBB Community Forums

Full Version: Search Box - Specific Forums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im using a external search box in my header.
At the moment it searches the whole forum, how can I modify the code so it only searches through a specific catergory?
Thanks in advance

<form method="post" action="search.php">
<label style="font-size: 11px;">Search:</label>
<input type="hidden" name="action" value="do_search" />
<input type="hidden" name="postthread" value="1" />
<input type="hidden" name="forums" value="all" />
<input type="hidden" name="showresults" value="threads" />
<input type="text" class="textbox" name="keywords" value="" />
<input type="submit" class="button" value="Go" />
</form>
Good question. I'd also like to know how to do this.
A dropdown menu for all the sections right next to the search bar would be wonderful!

Have a look at this example I made:

<select name="forums[]" size="20" multiple="multiple">
<option value="all" selected="selected">Search All Open Forums</option>
<option value="1">Section Name</option>
<option value="2">Section Name</option>
<option value="3">Section Name</option>
(etc.)
</select>

(the value number represents the forum ID)
I was thinking it was something to do with
 <input type="hidden" name="forums" value="all" />
Changing the value to the fids or something, but im not quite sure.
Well, try it. Should work for a simple forum specific search.

I was trying to create a drop down menu for all the sections so the users can select one.
Any update how can one do this?