adding a search feature

Is message board greying out your hair (at least what's left of it)? Let us help you here
Locked
wkilc

adding a search feature

Post by wkilc »

...also allows access to "old" postings in some sense.

Hi all,

Thought I'd share a solution that worked for me...

This may not ideally the best way to do it... but it will allow access to older messages (in the "msg" folder) via a simple search engine... and it adds a nice little search feature at the same time.

If you install the "Simple Search" script from:
http://www.scriptarchive.com/search.html
(You'll have to follow the directions... it's not too hard.)

You can then set the search script to search ONLY the HTML files in the "msg" folder:
The line in the search.pl script's settings would be something like:
@files = ('mboard/msg/*.html');

You don't necessarily need to use the deafult html that comes with the search script either, with the big search code with all the boolean's and what not... in fact, I just installed the Perl script and then created a search box using this code:

Code: Select all

<form method="POST" name="search_mboard" action="../cgi-bin/search/search.pl"><input type="text" name="terms" size="26" value="Search Message Board" onFocus="if(this.value=='Search Message Board') {this.value='';}" onBlur="if(this.value=='') {this.value='Search Message Board';}"><input type=hidden name=boolean value=AND>&nbsp;&nbsp;<input type=hidden name=case value=Insensitive>&nbsp;<input type=submit value="Go!">
</form>
Paste this into mboard.php... which gives me something that looks like this:
http://rimea.org/mboard/screen1.gif

If you're so inclined, you can even modify search.pl to customize the look of the search results page.

Best,

~Wayne
Locked