PDA

View Full Version : Google search in Navbar


attroll
06-29-2005, 10:00 PM
At the request from a couple others I am posting this. This hack that lets you put a Google search bar in your navagation bar. It gives you the options of Google searching your site or the intire web.

To add your site you will have to replace "your-site.com" with your sites domain name in the code that you need to add below.

Go to navagation / breadcrumb templates and go to navbar.

Find:

<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php?$session[sessionurl]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
</if>
</td>


After that add:

<!-- SiteSearch Google -->
<td class="alt2" valign="top" nowrap="nowrap">
<div class="smallfont">
<form method="get" action="http://www.google.com/custom" target="google_window">
<table border="2" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="1" width="100%" bgcolor="#F0F0F0" bordercolor="#336600">
<td bgcolor="#D6D6D6"><center>
<input type="hidden" name="domains" value="your-site.com"></input>
<input type="text" name="q" size="40" maxlength="255" value=""></input>
<input type="radio" name="sitesearch" value="" checked="checked"></input>
<font size="-1" color="#000000">Web</font>
<input type="radio" name="sitesearch" value="your-site.com"></input>
<font size="-1" color="#000000">your-site.com</font>
<input type="submit" name="sa" value="Google"></input>
<input type="hidden" name="client" value="pub-2871740088182458"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="safe" value="active"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center ;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000 000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="en"></input>
</center>
</td>
</TABLE>
</form>
</div>
</td>
<!-- SiteSearch Google -->

Cixxtynine
06-30-2005, 08:23 PM
It's just on the main page, how to put it on every page?

attroll
07-01-2005, 05:40 AM
It's just on the main page, how to put it on every page?

If you put it in your Navagation/Breadcrumb Template in the NAVBAR template like I posted it should be showing up in you navbar on every page.

kregger
07-15-2005, 09:18 PM
Hmmm. The site search goes to google. Is it supposed to search my forum just like the regular search does?

attroll
07-16-2005, 07:11 AM
Hmmm. The site search goes to google. Is it supposed to search my forum just like the regular search does?

There is a option you have to pick one is to search the web abd the other is to search your web site. Maybe you have the option set of the Web.

kregger
07-16-2005, 11:56 AM
I triple checked that. Every search opens a Google window though. In the code it says,
<form method="get" action="http://www.google.com/custom" target="google_window">
That sounds like its supposed to always do that instead of being like a regular forum search. Of course, I don't know very much about code. hehe I'm just a beginner.

attroll
07-17-2005, 03:33 AM
I triple checked that. Every search opens a Google window though. In the code it says,
<form method="get" action="http://www.google.com/custom" target="google_window">
That sounds like its supposed to always do that instead of being like a regular forum search. Of course, I don't know very much about code. hehe I'm just a beginner.

Ok here is what you do:
Find the following code:

<input type="radio" name="sitesearch" value="" checked="checked"></input>
<font size="-1" color="#000000">Web</font>


Remove the following code:

checked="checked"


Now find this code:

<input type="radio" name="sitesearch" value="your-site.com"></input>
<font size="-1" color="#000000">your-site.com</font>


Now put the following code in this line:

checked="checked"


It should now look like this


<input type="radio" name="sitesearch" value="your-site.com" checked="checked"
></input>
<font size="-1" color="#000000">your-site.com</font>


This should make it so that it defaults to do the search of your web site.

kregger
07-17-2005, 05:07 AM
Nope, it just makes the radio button for my site default. Still jumps to Google though. Nothing on my site that Google would find other than if I searched for the name of my site.

attroll
07-17-2005, 02:43 PM
Nope, it just makes the radio button for my site default. Still jumps to Google though. Nothing on my site that Google would find other than if I searched for the name of my site.

I just registered on your site and tried it. I set the radio button to WPLH and typed the word "work" and it came up with the gollowing:

Work Place Like Home :: (http://www.workplacelikehome.com/board/) Work Place Like Home Forum Index, Work Place Like Home ... Search: Search at:. Work Place Like Home, Google. Advanced Forum Search ...
www.workplacelikehome.com/board/ - Similar pages (http://www.google.com/custom?hl=en&lr=&ie=UTF-8&oe=ISO-8859-1&safe=active&client=pub-2871740088182458&cof=FORID:1%3BGL:1%3BBGC:FFFFFF%3BT:%23000000%3BLC :%230000ff%3BVLC:%23663399%3BALC:%230000ff%3BGALT: %23008000%3BGFNT:%230000ff%3BGIMP:%230000ff%3BDIV: %23336699%3BLBGC:336699%3BAH:center%3B&domains=http://www.workplacelikehome.com&sitesearch=http://www.workplacelikehome.com&q=related:www.workplacelikehome.com/board/)

This is a search result for your web site.

What this hack does is not search your web site. It searches Google for items that are from your web site (if you set the radio button to WPLH). If google has not been crawling and searching your web site then it will not bring anything up. So if your site is still fairly new it will take a while got google to build up a search data base. If you have the search spyders turned off that will keep google from searching your site also.

kregger
07-25-2005, 07:17 PM
Oooh. Well that's the prob. hehe No, I'm not listed on Google or have spyders. I have 4195 members, but its all from word of mouth. As a result, I have very little problem with spammers.

Okay, so I just need to get rid of the WPLH part. Thanks for the info!

Craig