PDA

View Full Version : Simple Search (similiar to vB 3)


Gary King
09-28-2003, 06:21 PM
What does this hack do?

It adds a link to your forumhome (or really any other template you want), and it allows your members to quickly search for something on your board, without going to any new pages.

Installation

Open the headinclude template and find
<style type="text/css">Above it, add<script LANGUAGE="Javascript">
<!--
function simplesearch(forumid)
{
// prompt for a search string
if (query = prompt("Search forums for threads containing the following word(s)...", ""))
{
if (forumid)
{
query = query + '&forumchoice=' + forumid;
}
window.location = "search.php?query=" + query + "&forumchoice=-1&searchdate=-1&beforeafter=after&sortby=lastpost&sortorder=descending&action=simplesearch&Submit=Perform+Search";
}
}

//-->
</script>

For this upcoming step, you can actually put the code <a href="javascript:simplesearch();">Simple Search</a> anywhere you'd like, either in the header, footer, or maybe just stick with what I've got, and keep it in the forumhome. It's completely up to you :)

Open forumhome template and find <td align="right"><smallfont>$welcometext<br><b>$newposts


After that, add <br /><a href="javascript:simplesearch();">Simple Search</a>

Installation is now complete, enjoy :)

Screenshots

Check this post's attachments.

assassingod
09-28-2003, 06:27 PM
This isn't a hack since it doesn't modify any vB files or am I missing something?

Gary King
09-28-2003, 06:29 PM
This isn't a hack since it doesn't modify any vB files or am I missing something?
Ah yes, my mistake :rolleyes:

assassingod
09-28-2003, 06:31 PM
Ah yes, my mistake :rolleyes:
Too bad this isn't a hack, it would be your 20th;)

Dean C
09-28-2003, 06:36 PM
<i>Moved</i>

Gary King
09-28-2003, 07:07 PM
If I created an external .js file, though, then that'd considered a hack wouldn't it? ;)

assassingod
09-28-2003, 07:11 PM
I doubt it, you can still upload files and it not be a hack (You can even run queries and it's not considered a hack)

Gary King
09-28-2003, 09:50 PM
I doubt it, you can still upload files and it not be a hack (You can even run queries and it's not considered a hack)
Okay, okay :rolleyes: