October 22, 2018, 01:13:40 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

New Search Bar

Pages: [1]   Go Down
  Print  
Author Topic: New Search Bar  (Read 693 times)
Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
« on: September 07, 2009, 06:43:29 pm »

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
« Last Edit: November 19, 2009, 08:30:51 pm by Agent Moose » Report Spam   Logged


Social Buttons

xboi209
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 235


View Profile WWW
Badges: (View All)
« Reply #1 on: September 07, 2009, 07:04:37 pm »

hmm, i didn't expect this to be in the footers though but its still good Smiley
Report Spam   Logged
Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
« Reply #2 on: September 07, 2009, 08:57:39 pm »

If you put it in the headers, it would be to high to get anything Tongue
Report Spam   Logged


xboi209
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 235


View Profile WWW
Badges: (View All)
« Reply #3 on: September 07, 2009, 09:03:39 pm »

yea but i was thinking of having one where you can put it anywhere you want.
Report Spam   Logged
DzinestaR
Starter
Starter
Offline Offline

Gender: Male
Posts: 21


View Profile WWW
Badges: (View All)
« Reply #4 on: September 07, 2009, 10:08:04 pm »

That's a great code.

-DzinestaR
Report Spam   Logged

Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
« Reply #5 on: September 08, 2009, 09:14:31 am »

yea but i was thinking of having one where you can put it anywhere you want.

I could make it so you can put it in the headers or footers Smiley  it will still have the same concept of searching what ever board you are viwing.
Report Spam   Logged


xboi209
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 235


View Profile WWW
Badges: (View All)
« Reply #6 on: September 08, 2009, 04:40:36 pm »

no thanks  Roll Eyes
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 | Buy traffic for your forum/website

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy