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.
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.