Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Replace search with Google Custom Search Details »»
Replace search with Google Custom Search
Version: 1.00, by Dave-ahfb Dave-ahfb is offline
Developer Last Online: Dec 2018 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 4.0.0 Beta 4 Rating:
Released: 11-30-2009 Last Update: Never Installs: 152
Template Edits
Re-useable Code  
No support by the author.

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

Screenshots

File Type: jpg Image1.jpg (107.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 01-14-2010, 03:01 AM
Verionia Verionia is offline
 
Join Date: Jul 2009
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nvm - I got it!!
Reply With Quote
  #53  
Old 01-18-2010, 02:46 PM
barbaras barbaras is offline
 
Join Date: Dec 2009
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nevermind.. Helps if ya read.
Reply With Quote
  #54  
Old 01-20-2010, 10:11 AM
M4r5h4ll M4r5h4ll is offline
 
Join Date: Sep 2007
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i keep on getting this error "Your client has issued a malformed or illegal request. "

& also the google.php logs me out from my forum donno why :x
Reply With Quote
  #55  
Old 02-22-2010, 01:40 PM
Spika's Avatar
Spika Spika is offline
 
Join Date: Jun 2006
Location: Marbella - Spain
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SemperFideles View Post
Here is the process I used to create a custom search results page. You can see the search in operation at http://www.puritanboard.com
Thank you very much! your custom search works fine!
Reply With Quote
  #56  
Old 02-22-2010, 03:27 PM
goddess_dix's Avatar
goddess_dix goddess_dix is offline
 
Join Date: Mar 2007
Location: Kansas
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SemperFideles View Post
Here is the process I used to create a custom search results page. You can see the search in operation at http://www.puritanboard.com
Thanks for laying out your process so clearly (and to the original author of the thread for the edit list). This helped me a great deal in getting mine to work.
Reply With Quote
  #57  
Old 02-23-2010, 09:18 PM
Jabong82 Jabong82 is offline
 
Join Date: Feb 2010
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work for 4.0.2? I don't have those exact fields to be edited in the original posters template edits.

I can get the google watermark to show up in the search box, but when I do a search it just leads to a blank screen.

Any help would be appreciated.
Reply With Quote
  #58  
Old 02-24-2010, 06:29 PM
nitra1000's Avatar
nitra1000 nitra1000 is offline
 
Join Date: Dec 2009
Location: uk
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes it does... it's working on my forum. Have you made the google.php?

@op, I've noticed the stylevars need adjusting for it to display properly on blogs, and also the search button is missing in IE7.

I'm having a play at the moment, but if you've fixed it could you update us
Reply With Quote
  #59  
Old 02-26-2010, 06:52 AM
Jabong82 Jabong82 is offline
 
Join Date: Feb 2010
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do you create the PHP page? I am able to embed the google logo in the search bar, but every time I pull up the google.php page I made I get a blank screen.

When I set the Navbar template edit from mydomain.com/google.php to mydomain.com/search.php it to the normal search.php its fine, but when I try to link it to the google.php page I created I just get a blank screen. How do you create the google.php? Like I said I can get the google logo in the search box fine, I just can't get the search to work.

I copied and pasted Semper's example google.php and that didn't work for me. I also tried to create a google.php with just the code google gave me. They both don't work. How do you create the google.php file?

Any help would be appreciated.


Edit: Nevermind Got it. Nice mod
Reply With Quote
  #60  
Old 03-13-2010, 03:49 PM
Scan Cape Cod's Avatar
Scan Cape Cod Scan Cape Cod is offline
 
Join Date: Aug 2005
Location: Cape Cod Massachusetts
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed with many props to SemperFideles for his step by step guide. Works superbly. Nice hack, and greatly appreciated. Thanks! Installed, nominated, etc.
Reply With Quote
  #61  
Old 03-27-2010, 06:16 PM
messi93 messi93 is offline
 
Join Date: Nov 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi , I install the mod and its Ok , but when i going to use it. it say " Bad Request
Your client has issued a malformed or illegal request.

Can you help me please?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:10 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08142 seconds
  • Memory Usage 2,355KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (10)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete