Simple Machine Codes
November 22, 2009, 03:56:42 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Affiliates Code Index Staff List Calendar Members Login Register  

New Search Bar


Pages: [1]   Go Down
  Print  
Author Topic: New Search Bar  (Read 72 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,663



View Profile WWW
« on: September 21, 2009, 07:14:28 am »

Footers:
Code:
<script type="text/javascript">
var a = document.getElementsByTagName("form");
for(x=0;x<a.length;x++){
//Created by Agent Moose (revolutionx.smfforfree3.com)
if(a[x].action.match(/action=search2/i) && a[x].parentNode.valign == "top" && a[x].nowrap == "nowrap" && a[x].parentNode.parentNode.parentNode.parentNode.id == "upshrinkHeader2" && location.href.match(/board,(\d+)./i)){
a[x].innerHTML = "<form id='searchform' name='searchform' accept-charset='ISO-8859-1' method='post' action='" + smf_scripturl + "action=search2'><input type='text' style='width: 190px;' name='search'/><input id='brd" + RegExp.$1 + "' type='hidden' checked='checked' value='" + RegExp.$1 + "' name='brd[" + RegExp.$1 + "]'/><input type='submit' value='Search' name='submit'/></form>"
};};
</script>

Original Request: http://revolutionx.smfforfree3.com/index.php/topic,1073.0.html

This code is very simple.  It changes the search bar you have up top, to make it only search the board that you are in.  If you are on the index page, or any other page that doesn't deal with a board, it will search the whole forum Smiley

Enjoy Smiley

EDIT:
Code Updated
« Last Edit: November 19, 2009, 08:29:03 pm by Agent Moose » Report Spam   Logged



Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2006, Simple Machines LLC
ServerBeach Coupon