58sniper
07-22-2004, 10:15 PM
Here ya go - a module that allows you to search vB, and NINE other search engines - all from one module.
Create a new template, adv_portal_supersearch2, and paste this into it:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat smallfont" style="font-weight: bold;"><a style="float: $stylevar[right]" href="#" onclick="return toggle_collapse('forumhome_supersearch2');"><img src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomtopic].gif" width="13" height="12" border="0" alt="Collapse/Expand" /></a>$vba_options[portal_blockbullet] Super Search II</td>
</tr>
<tr id="collapseobj_forumhome_supersearch2" style="$vbcollapse[collapseobj_forumhome_randomtopic]">
<td class="alt1 smallfont">
<script type="text/javascript" language="JavaScript">
function startSearch(){
searchString = document.searchForm.searchText.value;
switch (document.searchForm.whichEngine.value) {
case "altavista":
finalSearchString = "http://www.altavista.com/web/results?q=" + searchString;
break
case "yahoo":
finalSearchString = "http://search.yahoo.com/search?p=" + searchString;
break
case "excite":
finalSearchString = "http://msxml.excite.com/info.xcite/search/web/" + searchString;
break
case "hotbot":
finalSearchString = "http://www.hotbot.com/?MT=" + searchString;
break
case "infoseek":
finalSearchString = "http://www.infoseek.com/Titles?qt=" + searchString;
break
case "lycos":
finalSearchString = "http://www.lycos.com/cgi-bin/pursuit?query=" + searchString;
break
case "aolnetfind":
finalSearchString = "http://netfind.aol.com/aolcom/search?query=" + searchString;
break
case "google":
finalSearchString = "http://www.google.com/search?q=" + searchString;
break
case "mysearch":
finalSearchString = "http://mysearch.myway.com/jsp/GGmain.jsp?searchfor=" + searchString;
break
case "netscape":
finalSearchString = "http://search.netscape.com/ns/search?query=" + searchString;
break
case "vb":
finalSearchString = "";
document.searchForm.action = "$vboptions[bburl]/search.php";
document.searchForm.method = "post";
document.searchForm.query.value = document.searchForm.searchText.value;
document.searchForm.submit();
return true;
break
default:
finalSearchString = "";
}
document.location = finalSearchString;
return true;
}
</script>
<form name="searchForm" method="post" action="">
Search for: <input name="searchText" type="text" /> <b>@</b>
<input type="hidden" name="do" value="process" />
<input type="hidden" name="showposts" value="0" />
<input type="hidden" name="query" />
<select name="whichEngine">
<option value="vb">$vboptions[bbtitle]</option>
<option value="altavista">Altavista</option>
<option value="yahoo">Yahoo!</option>
<option value="excite">Excite</option>
<option value="hotbot">Hotbot</option>
<option value="infoseek">Infoseek</option>
<option value="lycos">Lycos</option>
<option value="aolnetfind">AOL Netfind</option>
<option value="google">Google</option>
<option value="mysearch">MySearch</option>
</select>
<input type="button" value="Search" onclick="startSearch();" />
</form>
</td>
</tr>
</table>
<br />
In AdminCP, create a new module:
name: "Super Search II"
template: "supersearch2"
active: yes
column: left
demo (http://www.efhs84.com/) on the left, at the bottom.
I can certainly add some more search engines, but you get the idea....
This script will almost certainly blow your XHTML validation. If/when I get some time, I'll work on that (shouldn't take anything more than exporting the javascript to an external .js file & some testing).
Let me know what you think.
Create a new template, adv_portal_supersearch2, and paste this into it:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat smallfont" style="font-weight: bold;"><a style="float: $stylevar[right]" href="#" onclick="return toggle_collapse('forumhome_supersearch2');"><img src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomtopic].gif" width="13" height="12" border="0" alt="Collapse/Expand" /></a>$vba_options[portal_blockbullet] Super Search II</td>
</tr>
<tr id="collapseobj_forumhome_supersearch2" style="$vbcollapse[collapseobj_forumhome_randomtopic]">
<td class="alt1 smallfont">
<script type="text/javascript" language="JavaScript">
function startSearch(){
searchString = document.searchForm.searchText.value;
switch (document.searchForm.whichEngine.value) {
case "altavista":
finalSearchString = "http://www.altavista.com/web/results?q=" + searchString;
break
case "yahoo":
finalSearchString = "http://search.yahoo.com/search?p=" + searchString;
break
case "excite":
finalSearchString = "http://msxml.excite.com/info.xcite/search/web/" + searchString;
break
case "hotbot":
finalSearchString = "http://www.hotbot.com/?MT=" + searchString;
break
case "infoseek":
finalSearchString = "http://www.infoseek.com/Titles?qt=" + searchString;
break
case "lycos":
finalSearchString = "http://www.lycos.com/cgi-bin/pursuit?query=" + searchString;
break
case "aolnetfind":
finalSearchString = "http://netfind.aol.com/aolcom/search?query=" + searchString;
break
case "google":
finalSearchString = "http://www.google.com/search?q=" + searchString;
break
case "mysearch":
finalSearchString = "http://mysearch.myway.com/jsp/GGmain.jsp?searchfor=" + searchString;
break
case "netscape":
finalSearchString = "http://search.netscape.com/ns/search?query=" + searchString;
break
case "vb":
finalSearchString = "";
document.searchForm.action = "$vboptions[bburl]/search.php";
document.searchForm.method = "post";
document.searchForm.query.value = document.searchForm.searchText.value;
document.searchForm.submit();
return true;
break
default:
finalSearchString = "";
}
document.location = finalSearchString;
return true;
}
</script>
<form name="searchForm" method="post" action="">
Search for: <input name="searchText" type="text" /> <b>@</b>
<input type="hidden" name="do" value="process" />
<input type="hidden" name="showposts" value="0" />
<input type="hidden" name="query" />
<select name="whichEngine">
<option value="vb">$vboptions[bbtitle]</option>
<option value="altavista">Altavista</option>
<option value="yahoo">Yahoo!</option>
<option value="excite">Excite</option>
<option value="hotbot">Hotbot</option>
<option value="infoseek">Infoseek</option>
<option value="lycos">Lycos</option>
<option value="aolnetfind">AOL Netfind</option>
<option value="google">Google</option>
<option value="mysearch">MySearch</option>
</select>
<input type="button" value="Search" onclick="startSearch();" />
</form>
</td>
</tr>
</table>
<br />
In AdminCP, create a new module:
name: "Super Search II"
template: "supersearch2"
active: yes
column: left
demo (http://www.efhs84.com/) on the left, at the bottom.
I can certainly add some more search engines, but you get the idea....
This script will almost certainly blow your XHTML validation. If/when I get some time, I'll work on that (shouldn't take anything more than exporting the javascript to an external .js file & some testing).
Let me know what you think.