Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vB Google Adsense for Search plus Integration Details »»
vB Google Adsense for Search plus Integration
Version: 1.4, by davidw davidw is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Add-On Releases - Version: 3.6.8 Rating:
Released: 08-13-2007 Last Update: 11-09-2007 Installs: 59
Uses Plugins Template Edits
Additional Files  
No support by the author.

Since the hooks came out in the navigation bar, I had been working on a new release as seen in my previous modification. I have recently pushed myself to finish this hack but I have plans for addons to it .

This is under the assumption you have your key information:
1) Your pub
(your pub ID/property information - usually starts with pub- and then some numbers)
2) Your cof usually found in your adsense code here:
Code:
<input name="cof" type="hidden" 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;LH:50;LW:250;L:http://www.christianboards.org/images/logo.gif;S:http://;FORID:1">
This example is what I am using and what a lot of others are using:
Code:
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:11
Step 1:
Upload searchresults.php to your site's root.
Example: http://www.yoursite.com/searchresults.php

Step 2:
Install the product
Go to Admincp => Plugins & Products => Manage Products => [Add/Import Product] => Browse for product-davidw_vb_google_search.xml => Import

Step 3:
Configure your Admincp options
Go to Admincp => vBullitin Options => vBulletin Options => Find vB Google Search (Adsense) then click [Edit Settings]
Edit your Pub ID, Cof, and your desired width of the iframe for your results. I use 800 in the screenshot, but you can change this based on your needs.

Step 4:
If you are using Version [s]1.2[/s] 1.3, or higher you must edit (or at least check) the searchresults.php to ensure it is correct for your site.

vBAdvanced Optional
Step 5:
Go to Admincp => vBA CMPS => Default Settings => Under Options Portal Output Global Variables
Add (or make sure they are present) these varaiables:
template_hook
google_navadsearch
google_label_site
google_label_web
homeurl

Step 6:
Click on Edit Modules. Click on Search Forums (module).
Under Module Tools, find Select Action (very top) and choose Copy.

In your new (copy) of the Search Forums Module, change the name of your module to whatever you want (I chose "Search").
Under the Template Module Options heading, edit the adv_portal_ area.
Change it from search to search_google

Next,
Under Module Shell Template Options, in the Form Code box,
Change
Code:
<form action="{$vbulletin->options[bburl]}/search.php" method="post" name="search"> <input name="s" type="hidden" value="" /> <input name="do" type="hidden" 

value="process" /> <input name="sortby" type="hidden" value="lastpost" /> <input name="forumchoice" type="hidden" value="0" />
To
Code:
<form method="get" action="http://www.yoursite.com/searchresults.php" type="hidden" name="search" target="_blank">
Make sure this URL is the correct full path to your searchresults.php file.


LEGACY VERSION - Applies to [s]vb_google_legacy_1_2.zip[/s] vb_google_legacy_1_3.zip(or higher) only
- Very similar to Version [s]1.2[/s] 1.3 and higher except instead of using a hook this will work for previous 3.6 versions (should work with any 3.6 version).
-- -- Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => Navigation / Breadcrumb Templates => navbar => find
Code:
$vbphrase[advanced_search]</a></td>
		</tr>
Add, under $google_navadsearch
-- Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => Search Templates => search_forums => under $navbar, add $google_siteadsearch

Also, you must ensure that $google_navadsearch does not go in between <form> tags. If your navbar is a modified old-style template, you will have an extended <form> section. Make changes similar to this...
change this:
Code:
        <form action="search.php?do=process" method="post">
        <table cellpadding="4" cellspacing="1" border="0">
        <tr>
            <td class="thead">$vbphrase[search_forums]</td>
        </tr>
to
Code:
        <table cellpadding="4" cellspacing="1" border="0">
        <tr>
            <form action="search.php?do=process" method="post">
            <td class="thead">$vbphrase[search_forums]</td>
        </tr>
and change
Code:
        </tr>
$google_navadsearch
$template_hook[navbar_search_menu]
        </table>
        </form>
    </div>
    <!-- / header quick search form -->
to
Code:
        </form>
        </tr>
$google_navadsearch
$template_hook[navbar_search_menu]
        </table>
    </div>
    <!-- / header quick search form -->

Changelog
Version 1.4
- Added support for vBAdvanced module (rather than going to my hack on vBAdvanced.com)

Version 1.3
- Added missing template cache plugins from XML file (had the template cache in the file, just lost it along the way in the XML).

Version 1.2
- Allows you to put your searchresults.php file in any directory, but you must edit the path in the searchresults.php file to the location of searchresults.php.
- Removed unnecessary xml information.
- Fixed a small bug in the product
- Added search.php functionality
-- Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => Search Templates => search_forums => under $navbar, add $google_siteadsearch
- Set default values so that it is easier to configure. You must still edit these values.

Version 1.1
- Change default "site" to your site's name or put a link to a small logo there.
- Change default "web" to "Google" or put their logo in there.
Code:
<img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle">
This is their logo if you don't have it.
- Only added the ability to allow you to easily add your own logos or change the text from the admincp.

Version 1.0
- Original

Show Your Support

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

Comments
  #112  
Old 11-09-2007, 10:53 PM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by davidw View Post
Not in the current form, but I am going to be working on a new version - that module will work on any version of vb (which is what it was intended for). I will post something when I have it created.
Superb. Cant wait for it to be released. For the time being, is there anyway the page can be edited so a logo or such like shows up?
Reply With Quote
  #113  
Old 11-09-2007, 11:50 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let me see what I can do
temporarily try this...
change the vba template from
Code:
<tr>
<td class="$bgclass">
	<input name="q" type="text" size="21" maxlength="255" value=""><br>
	<input name="sitesearch" type="radio" value="www.yourwebsite.com" checked> Yourwebsite<br>
	<input name="sitesearch" type="radio" value=""><a href="http://www.google.com/search"><img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></A>&nbsp;&nbsp;&nbsp; $gobutton
	<div class="smallfont">&raquo; <a href="$vboptions[bburl]/search.php?">$vbphrase[advanced_search]</a></div>
</td>
</tr>
to
Code:
<tr>
<td class="$bgclass">
    <table border="0">
        <tr>
            <td nowrap="nowrap">
                <input type="hidden" name="domains" value="{$vboptions['homeurl']}"></input>
                <input type="text" name="q" size="21" maxlength="255" value=""></input>
                <input type="submit" name="sa" value="Go"></input>
            </td>
        </tr>
        <tr>
            <td nowrap="nowrap">
                <table border="0">
                    <tr>
                        <td>
                            <input type="radio" name="sitesearch" value="{$vboptions['homeurl']}" checked id="ss1"></input>
                            <label for="ss1" title="Search {$vboptions['homeurl']}">{$vboptions['google_label_site']}</label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="radio" name="sitesearch" value="" id="ss0"></input>
                            <label for="ss0" title="Search the Web">{$vboptions['google_label_web']}</label>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
	<div class="smallfont">&raquo; <a href="$vboptions[bburl]/search.php?">$vbphrase[advanced_search]</a></div>
</td>
</tr>
and [from step 3 of the adsense.txt file] change
Code:
<form action="http://www.google.com/custom" type="hidden" method=GET name="search"> <input type="hidden" name="client" value="pub-0123456789012345"> <input type="hidden" name="forid" value="1"> <input type="hidden" name="ie" value="ISO-8859-1"> <input type="hidden" name="oe" value="ISO-8859-1"> <input name="cof" type="hidden" value="GALT:# . . .;"> <input name="domains" type="hidden" value="www.yourdomain.com"> <input type="hidden" name="hl" value="en">
to
Code:
<form method="get" action="{$vboptions['google_forum_path']}" target="_top"><input type="hidden" name="client" value="{$vboptions['google_pub']}"><input type="hidden" name="forid" value="1"><input type="hidden" name="ie" value="ISO-8859-1"><input type="hidden" name="oe" value="ISO-8859-1"><input type="hidden" name="cof" value="{$vboptions['google_cof']}"><input type="hidden" name="hl" value="en">
This should technically work, but I've not tested it

Remember make a backup of what you have before changing anything. Of course, you will also need to add any variables to the admincp just like in this post. https://vborg.vbsupport.ru/showpost....7&postcount=93
Reply With Quote
  #114  
Old 11-10-2007, 01:33 AM
The_Gun_Man The_Gun_Man is offline
 
Join Date: Oct 2007
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any reason why the

vbulletin3_logo_white.gif
navbits_finallink_ltr.gif
navbits_start.gif

Don't showup on the search results page? I've tried both versions and the same results. I have the default skin.
Reply With Quote
  #115  
Old 11-10-2007, 02:10 AM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, they should show up. I am pulling $header and $navbar - do you have a link to your site I can view?

Btw, don't forget to click Install
Reply With Quote
  #116  
Old 11-10-2007, 08:25 AM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by davidw View Post
Let me see what I can do
temporarily try this...
change the vba template from
Code:
<tr>
<td class="$bgclass">
	<input name="q" type="text" size="21" maxlength="255" value=""><br>
	<input name="sitesearch" type="radio" value="www.yourwebsite.com" checked> Yourwebsite<br>
	<input name="sitesearch" type="radio" value=""><a href="http://www.google.com/search"><img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></A>&nbsp;&nbsp;&nbsp; $gobutton
	<div class="smallfont">&raquo; <a href="$vboptions[bburl]/search.php?">$vbphrase[advanced_search]</a></div>
</td>
</tr>
to
Code:
<tr>
<td class="$bgclass">
    <table border="0">
        <tr>
            <td nowrap="nowrap">
                <input type="hidden" name="domains" value="{$vboptions['homeurl']}"></input>
                <input type="text" name="q" size="21" maxlength="255" value=""></input>
                <input type="submit" name="sa" value="Go"></input>
            </td>
        </tr>
        <tr>
            <td nowrap="nowrap">
                <table border="0">
                    <tr>
                        <td>
                            <input type="radio" name="sitesearch" value="{$vboptions['homeurl']}" checked id="ss1"></input>
                            <label for="ss1" title="Search {$vboptions['homeurl']}">{$vboptions['google_label_site']}</label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="radio" name="sitesearch" value="" id="ss0"></input>
                            <label for="ss0" title="Search the Web">{$vboptions['google_label_web']}</label>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
	<div class="smallfont">&raquo; <a href="$vboptions[bburl]/search.php?">$vbphrase[advanced_search]</a></div>
</td>
</tr>
and [from step 3 of the adsense.txt file] change
Code:
<form action="http://www.google.com/custom" type="hidden" method=GET name="search"> <input type="hidden" name="client" value="pub-0123456789012345"> <input type="hidden" name="forid" value="1"> <input type="hidden" name="ie" value="ISO-8859-1"> <input type="hidden" name="oe" value="ISO-8859-1"> <input name="cof" type="hidden" value="GALT:# . . .;"> <input name="domains" type="hidden" value="www.yourdomain.com"> <input type="hidden" name="hl" value="en">
to
Code:
<form method="get" action="{$vboptions['google_forum_path']}" target="_top"><input type="hidden" name="client" value="{$vboptions['google_pub']}"><input type="hidden" name="forid" value="1"><input type="hidden" name="ie" value="ISO-8859-1"><input type="hidden" name="oe" value="ISO-8859-1"><input type="hidden" name="cof" value="{$vboptions['google_cof']}"><input type="hidden" name="hl" value="en">
This should technically work, but I've not tested it

Remember make a backup of what you have before changing anything. Of course, you will also need to add any variables to the admincp just like in this post. https://vborg.vbsupport.ru/showpost....7&postcount=93
Thanks for that, I gave it a go but it threw up loads of errors. Not sure if this was caused by me not adding:
Quote:
you will also need to add any variables to the admincp
as I wasnt sure what I needed to add. Also where does the pub code go?

Was a little bit confused. Thanks anyway

Dave
Reply With Quote
  #117  
Old 11-10-2007, 08:50 AM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One more question without wishing to be pain!

On the normal search where it shows the header - is is possible to have links open in a new tab or actually within the site itself?
Reply With Quote
  #118  
Old 11-10-2007, 02:44 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The pub is being called from the adminCP - originally the module kept it in a secondary location.
To open in a new page, you would edit this part
<form method="get" action="{$vboptions['google_forum_path']}" target="_top">
and change top to blank.
I may have time to work on this today.
Reply With Quote
  #119  
Old 11-10-2007, 03:20 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by psychotronic View Post
I found it david..

- Admin CP> vBa CMPS > Default Settings> Main Options>
- Under the 'Portal Output Global Variables' setting you will need to add "google_navadsearch"

and.. voilaaaa.. they show up!!!!
Some people may need to add the variable template_hook there as well for it to show up correctly (as that is what I had overlooked).
Reply With Quote
  #120  
Old 11-10-2007, 04:18 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I have a working prototype on my site now
Edit: I have updated the modification to add the vbadvanced (version 1.4).
Reply With Quote
  #121  
Old 11-10-2007, 07:54 PM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the update

Ive got it all installed, however one problem with the vbadvance module. When I hit search, it takes me to the searchresults.php page, however this is blank.

Is the same for searching the site and searching google, however it works fine when searching via the dropdown navbar.
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 01:48 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.04798 seconds
  • Memory Usage 2,352KB
  • Queries Executed 25 (?)
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
  • (18)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete