Solved: 14 Years, 4 Months ago Adding Search Box
#1
Solved: 14 Years, 4 Months ago
Just wondering if it was possible to add a search box to the top of the forum. Sort of like what you guys have.

Thanks,
Ruben
[Image: SIG2-1.png]
#2
Solved: 14 Years, 4 Months ago
~BUMP~
[Image: SIG2-1.png]
#3
Solved: 14 Years, 4 Months ago
Put something like this in your header template:
<form action="search.php" method="get">
<input name="keywords" title="Enter your search keywords" type="text" />
<input value="Search Forum" name="submit-search" type="submit" />
<input type="hidden" name="action" value="do_search" />
</form>
Dennis Tsang
Former MyBB Team Member
Web: http://dennistt.net
#4
Solved: 14 Years, 4 Months ago
Any specific place?
[Image: SIG2-1.png]
#5
Solved: 14 Years, 4 Months ago
Well wherever you want it... can't be much more specific than that, you want it where you want it.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
#6
Solved: 14 Years, 4 Months ago
(2008-10-23, 10:00 PM)Matt_ Wrote: Well wherever you want it... can't be much more specific than that, you want it where you want it.
Sorry Man.
[Image: SIG2-1.png]
#7
Solved: 14 Years, 4 Months ago
(2008-10-23, 10:00 PM)Matt_ Wrote: Well wherever you want it... can't be much more specific than that, you want it where you want it.

Go Matt, lol.

You can also use hidden form fields to control what options are used in the search, for example you can use them to only search for topics, or only search in posts etc.
#8
Solved: 14 Years, 4 Months ago
(2008-10-24, 08:05 AM)Tom.M Wrote:
(2008-10-23, 10:00 PM)Matt_ Wrote: Well wherever you want it... can't be much more specific than that, you want it where you want it.
How?
You can also use hidden form fields to control what options are used in the search, for example you can use them to only search for topics, or only search in posts etc.

How?
[Image: SIG2-1.png]
#9
Solved: 14 Years, 4 Months ago
<!-- Pick and choose: -->

<!-- Content to search -->
<input type="hidden" name="postthread" value="1" /> <!-- message and title -->
<input type="hidden" name="postthread" value="2" /> <!-- title only -->

<!-- Forums to search -->
<input type="hidden" name="forums[]" value="2" /> <!-- replace "2" with forum ID.  Add multiple lines for multiple forums.  If you don't have this line, the default is all forums -->

<!-- Example for searching forums IDs 2, 4, 6 -->
<input type="hidden" name="forums[]" value="2" />
<input type="hidden" name="forums[]" value="4" />
<input type="hidden" name="forums[]" value="6" />

<!-- Display results as -->
<input type="hidden" name="showresults" value="threads" /> <!-- threads -->
<input type="hidden" name="showresults" value="posts" /> <!-- posts -->
There are also date and sorting options, but I'm not going to go through all of them because I don't have that much time. If you want some specific setting let us know (check from the search page what you want by default) and we'll post the hidden fields you need
Dennis Tsang
Former MyBB Team Member
Web: http://dennistt.net
#10
Solved: 14 Years, 4 Months ago
Thanks!
[Image: SIG2-1.png]


Forum Jump:


Users browsing this thread: 7 Guest(s)