vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add-On Releases - vB Google Adsense for Search plus Integration (https://vborg.vbsupport.ru/showthread.php?t=155199)

davidw 08-13-2007 10:00 PM

vB Google Adsense for Search plus Integration
 
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

davidw 08-14-2007 11:05 AM

I have a manual limited version of this here: https://vborg.vbsupport.ru/showthread.php?t=128274

projectego 08-14-2007 11:19 AM

[high]* projectego clicks install :D[/high]

alqloob alsahya 08-14-2007 01:14 PM

god jop nice :)

davidw 08-14-2007 01:52 PM

Edit: Updated the product - one of the templates had a typo.

Zaiaku 08-14-2007 06:56 PM

Excellent mod!

Chester87 08-14-2007 06:59 PM

Verry nice mod.

iogames 08-14-2007 07:44 PM

If it's a 'DAVIDW' I'll install it!
Can you add the Google Logo or the option for Own logo?

United32 08-14-2007 07:47 PM

Thank you very much! And for integration, wow.... :up:

MOTM, definately! :)

davidw 08-14-2007 10:13 PM

Quote:

Originally Posted by iogames (Post 1317580)
If it's a 'DAVIDW' I'll install it!
Can you add the Google Logo or the option for Own logo?

Where did you have in mind?

Quote:

Originally Posted by United32 (Post 1317581)
Thank you very much! And for integration, wow.... :up:

MOTM, definately! :)

Actually, I'm not even done yet. I'm going to be adding more :)

davidw 08-15-2007 10:39 AM

I have added an optional new 1.1 version that allows anyone to change the choices by the radio buttons to logos (images) if they so desire :) - and I have supplied the link to the default logo above.

Zaiaku 08-17-2007 09:50 PM

Is there a templete edit that needs to be done? I installed it and its not appearing in the dropdown search menu.

JMH11788 08-18-2007 05:31 PM

Quote:

Originally Posted by Zaiaku (Post 1319904)
Is there a templete edit that needs to be done? I installed it and its not appearing in the dropdown search menu.

well the navbar hook is gone now so that is why you dont see it.

davidw 08-20-2007 01:31 AM

You should have
Code:

$template_hook[navbar_search_menu]
in your navbar, if you don't - this will not work.

Search for
Code:

<!-- / header quick search form -->
and look a couple rows above:

Code:

                $template_hook[navbar_search_menu]
                </table>
        </div>
        <!-- / header quick search form -->

Your navbar may differ a little - this is where the hook resides:
Code:

                <tr>
                        <td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a></td>
                </tr>
                $template_hook[navbar_search_menu]

If you do not have that hook in there, you must edit your navbar and place that hook in there to use this modification. If you still can't get this version to work, here is a manual but limited version - https://vborg.vbsupport.ru/showthread.php?t=128274

AquilaEagle 08-20-2007 05:59 PM

I've installed and it is appearing in my Nav Bar, but when i actually do a search I just get a blank screen?? it's not going to google, it's going to some page on my site??

Help please?

AquilaEagle 08-20-2007 08:31 PM

Double checked everything, and re-installed it. Still not working. It seems to go to searchresults.php but with a load of code on the end of the url, just showing a blank page. I've followed the instructions word for word. No worky. :(

davidw 08-20-2007 10:26 PM

Ok, here's a possible manual fix for boards like this. I will work on an update later with a final working result.

Upload searchresults.php to your forum directory (since that is where it is appearing - It looks like a redirect somehow).

Then reimport this attached product (based on version 1.1)

davidw 08-21-2007 02:40 AM

Also, try this special searchresults.php file I created. You will need to edit line 8
PHP Code:

chdir('/your/path/to/forums/'); 

and put your forum's path in there for this to work. I have it working on my site (tested it). I created a dummy directory called forums that only has the one file in it. Let me know how it works for you.

AquilaEagle 08-21-2007 05:41 PM

Quote:

Originally Posted by davidw (Post 1321944)
Ok, here's a possible manual fix for boards like this. I will work on an update later with a final working result.

Upload searchresults.php to your forum directory (since that is where it is appearing - It looks like a redirect somehow).

Then reimport this attached product (based on version 1.1)

Thanks david. I have done this and it seems to half work, I did a search but I get a blank result. I get the Google search results page, but it is empty of any results.

AquilaEagle 08-21-2007 06:58 PM

Also. the dropdown only appears for members, not for guests - any way I can change that?

Irfan Faruki 08-23-2007 06:16 PM

Quote:

Originally Posted by AquilaEagle (Post 1322494)
Thanks david. I have done this and it seems to half work, I did a search but I get a blank result. I get the Google search results page, but it is empty of any results.

I am having the same problem.. Any ideas ?

davidw 08-23-2007 10:59 PM

How is your forum set up? Is it behind /forums/? Can you PM me the info? Btw, don't forget to click install.

Riccardo83 08-27-2007 03:57 AM

I dont get it working either on alizee-forum.com

It shows the searchresult.php correctly with theme. It also says

Your Google Search Results

but there is nothing underneath, footer and header work...

davidw 08-27-2007 10:34 AM

The searchresults.php is in its correct location. If you used any version other than the initial 1.0 (especially the one in the thread here alone), you must go to your admincp and enter your information in there.

Step 3:
Configure your Admincp options
Go to Admincp => vBullitin Options => vBulletin Options => Find vB Google Search (Adsense) then click [Edit Settings]

If you don't, you will get exactly what you see.

Don't forget to click install.

Riccardo83 08-27-2007 11:30 AM

i entered all information....

it still doesnt work....

GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center ;BGC:FFFFFF;LBGC:336699;ALC:00 00FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FO RID:1

and my pub google code.. logo as well....

please help me what could it be, 700 is iframe width, could it be that my galt is wrong?

AquilaEagle 08-27-2007 01:15 PM

Quote:

Originally Posted by Riccardo83 (Post 1326460)
I dont get it working either on alizee-forum.com

It shows the searchresult.php correctly with theme. It also says

Your Google Search Results

but there is nothing underneath, footer and header work...

This is what is happening on mine now.

All my info is in the adminCP too. I've not managed to catch you to help yet david.

Also it only appears for registered users, can I change it so everyone sees it in the menu?

Riccardo83 08-27-2007 06:49 PM

Hope this is gonna be fixed soon.

Also a suggestion would be, to have this search available for guests, but not letting them use the forum search engine.

Brings more adsense visits and reduces serverload.

davidw 08-28-2007 12:06 AM

I've added version 1.2 (at the top). I've fixed a few things and hopefully this will fix the problem. I noticed a couple possible issues that weren't being reported but might be related to what you two are seeing. You may want to uninstall the product and import the new 1.2 product, and overwrite the searchresults.php file after making the necessary changes to it. Let me know how this works.

Riccardo83 08-28-2007 04:02 AM

im afraid to say i still dont see any search results... ?

maybe anytyhing wrong with my google settings?

Although the sourcecode of the page shows

Code:

        <tr align="center">
                <td class="alt1" align="center" valign="top">
                        <div style="padding:5px 5px 5px 5px">
                        <!-- Google Search Result Snippet Begins -->
                        <div id="googleSearchUnitIframe"></div>
                        <script type="text/javascript">
                          var googleSearchIframeName = 'googleSearchUnitIframe';
                          var googleSearchFrameWidth = '750';
                          var googleSearchFrameborder = 0 ;
                          var googleSearchDomain = 'www.google.com';
                        </script>
                        <script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>

                        <!-- Google Search Result Snippet Ends -->
                        </div>


Riccardo83 08-28-2007 04:07 AM

also, i like the way u have it on ur forum, but u dont use searchresults.php or so?

davidw 08-28-2007 10:21 AM

I do use the searchresults.php (otherwise this wouldn't work). I am also using 1.2 version as well.

Riccardo83 08-28-2007 10:26 AM

ok, i added u on msn, but ur not online. i would really love to get this working.

AquilaEagle 08-28-2007 06:08 PM

I'm still getting a blank results page with v1.2 - completely uninstalled and re-installed. edited the searchresults.php file, and it is in /forum/

Attachment 69197

Zaiaku 08-28-2007 07:47 PM

To bad this doesn't work on all versions of 36x. I really don't want to have to upgrade my other forum to add this to it.

davidw 08-29-2007 01:20 AM

Give me a day or two and I'll see if I can find a script to work around the hook for earlier versions.

Riccardo83 08-29-2007 01:28 AM

But first we should get it working at all for 3.6.8 ? Any news why AquilaEagle and me dont get it working?

davidw 08-29-2007 01:29 AM

This version (for earlier versions) should also help you and AquilaEagle out as well. It should be released tomorrow.

Riccardo83 08-29-2007 01:59 AM

Great, thanks mate for helping me u got it working. Apparently guys double check ur Galt code as well!

WarLion 08-29-2007 08:00 PM

i have the samee result im install this mod pretty good BTW but with no result only the searchresults.php in blank

i hope you can tell me whats is wrong thanks for this cool mod

edit

ifinally maake it work you the only thing i edit is the template "google_navadsearch"

i change a few lines not to much i just see the original code from google adsense and add a few lines

Code:

<tr>
    <td class="thead">Buscar en sitio/ Google</td>
</tr>
<tr>
    <td class="vbmenu_option" title="nohilite">
    <form method="get" action="{$vboptions['google_forum_path']}" target="_top">
        <table border="0">
            <tr>
                <td nowrap="nowrap">
                    <input type="hidden" name="domains" value="{$vboptions['homeurl']}"></input>
<label for="sbi" style="display: none">Introduzca los t?rminos de b?squeda.</label>
<input type="text" class="bginput" name="q" size="25" maxlength="255" value="" id="sbi"></input>
<label for="sbb" style="display: none">Env?e el formulario de b?squeda</label>
<input type="submit" class="button" name="sa" value="Ir" id="sbb"></input>
</td>
            </tr>
            <tr>
                <td nowrap="nowrap">
                    <table border="0">
                        <tr>
                            <td>
<input type="radio" name="sitesearch" value="" checked id="ss0"></input>
<label for="ss0" title="Search the Web">{$vboptions['google_label_web']}</label>
                            </td>
                            <td>
<input type="radio" name="sitesearch" value="{$vboptions['homeurl']}" id="ss1"></input>
<label for="ss1" title="Search {$vboptions['homeurl']}">{$vboptions['google_label_site']}</label>
                            </td>
                        </tr>
                    </table>
<input type="hidden" name="client" value="{$vboptions['google_pub']}"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof" value="{$vboptions['google_cof']}"></input>
<input type="hidden" name="hl" value="es"></input>
</td>
            </tr>
        </table>
    </td></form>
</tr>

this is a code for mexican or spanish webs the las red text es (espa?ol) if you are from us change to en (english)
the rest you can leavee just like that is a hidden text

also in vB Google Search (Adsense) option on Your Forum's Path i only put the name of the php n this case searchresults.php cuz you are already in your domine if you put all the adress the resul migth bee
http://yoursite.com/forum/searchresu...://wwwyoursite......,
and also in the searchresults.php on the line 8 i change the path and thats all i need now is working now thankts for you mod is soo cool

i know this is almost equal to the one from davidw i dont know what i did the only this s woring now dot ask i don?t know what i did

and also i add class to button and textfield you can change it to fit your sikin

sorry for my english mexican here

davidw 08-29-2007 10:28 PM

Quote:

Originally Posted by Zaiaku (Post 1327592)
To bad this doesn't work on all versions of 36x. I really don't want to have to upgrade my other forum to add this to it.

Added a release to the list that should help you out. :)


All times are GMT. The time now is 06:01 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.02719 seconds
  • Memory Usage 1,862KB
  • 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
  • (16)bbcode_code_printable
  • (1)bbcode_php_printable
  • (7)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
  • (40)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