vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Mini Mods - Use Google Custom Search In Navbar - Step By Step (https://vborg.vbsupport.ru/showthread.php?t=263440)

rajubd 05-10-2011 10:00 PM

Use Google Custom Search In Navbar - Step By Step
 
1 Attachment(s)
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 google.php 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...

RobbieZ 05-11-2011 10:52 AM

Nice work.

Doesnt work on a closed forum where you have to log in to view the site as google cant access this!

rajubd 05-13-2011 01:15 AM

Quote:

Originally Posted by RobbieZ (Post 2194366)
Nice work.

Doesnt work on a closed forum where you have to log in to view the site as google cant access this!

Yes but you can use advanced or forum search..

obmob 06-03-2011 03:40 PM

Works really nice, the template makes it even better. :)

rajubd 06-06-2011 08:28 PM

Quote:

Originally Posted by obmob (Post 2203105)
Works really nice, the template makes it even better. :)

Thanks...

Vaira 06-09-2011 04:59 PM

I got global search results, but not for the website specific only.

Did I miss something?
I have removed the partner-pub-xxxxxxx:xxxxxx-xxxxxx line completely since I don't have a ad sense account

Thanks.

Vaira 06-10-2011 11:10 AM

OK I did some research....
This method is made to work with adsense only and is spread all over the net.

You simply cannot remove the line.

For non adsense users just go for that:
https://vborg.vbsupport.ru/showthrea...=241563&page=3

Ichigo88 06-11-2011 06:34 PM

4.1.3 not work -.-

rajubd 06-11-2011 06:52 PM

I am using it in my site with 4.1.3 ... try again

rajubd 06-11-2011 06:54 PM

Quote:

Originally Posted by Vaira (Post 2205796)
OK I did some research....
This method is made to work with adsense only and is spread all over the net.

You simply cannot remove the line.

For non adsense users just go for that:
https://vborg.vbsupport.ru/showthrea...=241563&page=3

I didn't test it for non AdSense users thanks for info...


All times are GMT. The time now is 09:47 PM.

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.01260 seconds
  • Memory Usage 1,741KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete