vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Google search in Navbar (https://vborg.vbsupport.ru/showthread.php?t=91394)

attroll 06-29-2005 10:00 PM

Google search in Navbar
 
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:
Code:

<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:
Code:

<!-- 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:000000;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

Quote:

Originally Posted by Cixxtynine
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

Quote:

Originally Posted by kregger
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,
Code:

<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

Quote:

Originally Posted by kregger
I triple checked that. Every search opens a Google window though. In the code it says,
Code:

<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:
Code:

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

Remove the following code:
Code:

checked="checked"
Now find this code:
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:
Code:

checked="checked"
It should now look like this
Code:


<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

Quote:

Originally Posted by kregger
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 :: 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


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


All times are GMT. The time now is 08:30 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01225 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete