Back to vBulletin 4.x Template Modifications

Use Google Custom Search In Navbar - Step By Step
Mod Version: 1.00, by rajubd

vB Version: 4.x.x Rating: (11 votes - 4.64 average) Installs: 97
Released: 11 May 2011 Last Update: Never Downloads: 895
Not Supported Template Edits  

This mod will replace vb search in navbar with google custom search.. you can still use advance search from navbar. google search provide much better result when you try to search word under 4 letters..

1. First download &stc=1&d=1305071107 upload in your forum root
2. Go to your AdminCP Go to Styles & Templates -> Style Manager
select Style then click Create New Template rename Template to GOOGLE
Paste this code in google Template :
Code:
{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
  <head>
    <title>{vb:raw vboptions.bbtitle}</title>
    {vb:raw headinclude}
  </head>
  <body>
    {vb:raw header}
    {vb:raw navbar}
    <div id="pagetitle">
      <h1>{vb:raw pagetitle}</h1>
    </div>
    <h2 class="blockhead">Google Custom Search</h2>
    <div class="blockbody">
      <div class="blockrow">
<div id="cse-search-results"></div>
<script type="text/javascript">
  var googleSearchIframeName = "cse-search-results";
  var googleSearchFormName = "cse-search-box";
  var googleSearchFrameWidth = 800;
  var googleSearchDomain = "www.google.com";
  var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
      </div>
    </div>
    {vb:raw footer}
  </body>
</html>
3. Then Open Navigation / Breadcrumb Templates Click Collapse button click navbar Template find <div id="globalsearch" class="globalsearch"> and <ul class="navbar_advanced_search"> remove all code between this with

Code:
<form action="http://www.mobilephonetalk.com/google.php" id="cse-search-box">
    <input type="hidden" name="cx" value="partner-pub-8038994048300561:7c8fy7cujxg" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
            <span class="textboxcontainer"><span><input type="text" value="" name="q" class="textbox" /></span></span>
            <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="sa" onclick="document.getElementById('navbar_search').submit;" />  </span></span>
        </form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>
Note : Replace http://www.mobilephonetalk.com with your won website name
Replace partner-pub-8038994048300561:7c8fy7cujxg with your won adsense code...

Download

File Type: %1$s google.php (1.2 KB, 994 downloads)

Screenshots

Click image for larger version
Name:	Capture.jpg
Views:	3346
Size:	91.4 KB
ID:	128977  


vblts.ru supports vBulletin®, 2022-2024