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)
-   -   Integration with vBulletin - Replace search with Google Custom Search (https://vborg.vbsupport.ru/showthread.php?t=229247)

Dave-ahfb 11-30-2009 10:00 PM

Replace search with Google Custom Search
 
1 Attachment(s)
This mod assumes you have an adsense account and are using Google Custom Search.

You want to make sure your results page is named something other than the vb default search.php, this leaves the vb option open to those who click "advanced search"

Open your template navbar


find
PHP Code:

<form action="search.php?do=process" method="post" id="navbar_search"


replace with the form line of the google supplied code
example:
PHP Code:

<form action="http://www.ahfb2000.com/google.php" id="cse-search-box"



find
PHP Code:

<input type="hidden" name="s" value="{vb:raw session.sessionurl}" />
<
input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<
input type="hidden" name="do" value="process" /> 


replace with the first 3 hidden input types in your google code
example:
PHP Code:

    <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxxxxxxxxxxxxxx" />
    <
input type="hidden" name="cof" value="FORID:10" />
    <
input type="hidden" name="ie" value="ISO-8859-1" /> 



find
PHP Code:

<input type="text" value="" name="query" class="textbox" /> 


replace with
PHP Code:

<input type="text" value="" name="q" class="textbox" /> 



find
PHP Code:

<input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="submit" onclick="document.getElementById('navbar_search').submit;" /> 


replace with
PHP Code:

<input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="sa" onclick="document.getElementById('navbar_search').submit;" /> 



find
PHP Code:

</form


add this after
PHP Code:

<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script


Dave-ahfb 12-01-2009 11:11 AM

Can a mod move this to vb 4 forums please

Arcade Fire 12-01-2009 02:19 PM

Thanks, installed.

abdobasha2004 12-02-2009 12:43 PM

wanted for 3.7 !

SİMAR 12-02-2009 09:40 PM

Thanks,

Dr.osamA 12-03-2009 12:53 PM

try try

installed
thnxxxx man
________
Masturbation School

g00gl3r 12-07-2009 06:44 PM

Reserved.

rtyagis 12-11-2009 01:36 PM

Reserved.

Tize. 12-12-2009 08:14 PM

Hello I have installed but when I give him a look I get this error.
I have made everything as you said.
Thank you.

HTML Code:

Not Found

The requested URL /google.php was not found on this server.
Apache/2.2.3 (CentOS) Server at www.ddirecta.com Port 80


Dave-ahfb 12-12-2009 08:34 PM

Read the instructions again. Some of the "replace" codes are examples and not to be taken literal.


All times are GMT. The time now is 04: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.01354 seconds
  • Memory Usage 1,755KB
  • 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
  • (1)bbcode_html_printable
  • (10)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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