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 10-16-2007 10:26 PM

Good job - I'm usually not on until evenings most of the time so I'm glad you got it sorted out.

yoyoyoyo 11-01-2007 12:20 PM

what do I need to change in the xml in order to remove the site search? I would rather that people use the site search engine, but want to keep the google search plugin-based

davidw 11-01-2007 10:55 PM

If you are referring to the search.php usage, nothing will be done there (or seen) unless you put in the $google_siteadsearch - all it will be is a template. However, if you want to remove it all, just find this:
Code:

                <template name="google_siteadsearch" templatetype="template" username="davidw" version="1.2"><![CDATA[<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
        <tr>
                <form method="get" action="{$vboptions['google_forum_path']}" target="_top"><td class="tcat">Search Google / Search Forums Using Google</td>
        </tr>
        <tr>
                <td class="panelsurround" align="center" title="nohilite">
                        <table class="panel" border="0" width="100%" align="center">
                                <tr>
                                        <td nowrap="nowrap" align="center" valign="top">
                                                <input type="hidden" name="domains" value="{$vboptions['homeurl']}"></input>
                                                <input type="text" name="q" size="31" maxlength="255" value=""></input>
                                                <input type="submit" name="sa" value="Go"></input>
                                        </td>
                                </tr>
                                <tr>
                                        <td nowrap="nowrap" align="center" valign="top">
                                                <table border="0">
                                                        <tr>
                                                                <td>
                                                                        <input type="radio" name="sitesearch" value="" 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']}" checked 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="en"></input>
                                        </td>
                                </tr>
                        </table>
                </td></form>
        </tr>
</table>]]></template>

and this
Code:

                <plugin active="1" executionorder="5">
                        <title><![CDATA[vB Google Search - Search.php]]></title>
                        <hookname>global_start</hookname>
                        <phpcode><![CDATA[global $db, $vbulletin;
eval('$google_siteadsearch .= "' . fetch_template('google_siteadsearch') . '";');]]></phpcode>
                </plugin>

and remove both of those.

Btw, don't forget to click install :)

yoyoyoyo 11-02-2007 01:07 AM

what I was asking is how to make the google search just the www and not your site

davidw 11-02-2007 01:25 AM

oh, take that option out of the templates

Find and remove:
Code:

                                                        <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>

and
Code:

                                                                <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>

you could also remove both instances of
Code:

<input type="hidden" name="domains" value="{$vboptions['homeurl']}"></input>
but that's up to you

yoyoyoyo 11-02-2007 04:04 AM

ok thanks much!

on another note, microstats is showing this:
Uncached templates: google_navadsearch (1)
Uncached templates: google_siteadsearch (1)

how do I fix that?

davidw 11-02-2007 11:07 AM

That's weird - let me look into that tonight.

davidw 11-02-2007 11:50 PM

For some reason when I started on this project, I omitted it, this is the missing plugin -

Code:

                <plugin active="1" executionorder="5">
                        <title><![CDATA[vB Google Cache Templates]]></title>
                        <hookname>cache_templates</hookname>
                        <phpcode><![CDATA[$globaltemplates[] = 'google_navadsearch';
$globaltemplates[] = 'google_siteadsearch';
$globaltemplates[] = 'google_searchresults';]]></phpcode>
                </plugin>

I will upload an update later.

davidw 11-03-2007 12:19 AM

Ok, latest and greatest has been uploaded :) (I won't send an update since the version difference is negligible.)

psychotronic 11-03-2007 02:51 AM

dear david
the $google_navadsearch i put on the navbar template
but just show on on forum page..
i use vBadvanced CMPS but they not showing up on the navbar
do i miss something?

thanks before

davidw 11-03-2007 03:02 AM

That is something I'm still working on as well - I'm having an issue with the navbar in vbadvanced with a few items that use hooks.

yoyoyoyo 11-03-2007 03:53 AM

thanks for the update

psychotronic 11-03-2007 11:30 AM

Quote:

Originally Posted by davidw (Post 1374609)
That is something I'm still working on as well - I'm having an issue with the navbar in vbadvanced with a few items that use hooks.


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!!!!

davidw 11-03-2007 12:49 PM

That's funny - I've already put it there - I may have misspelled it on my site though. Thanks for looking into that. :)

davidw 11-03-2007 12:50 PM

Quote:

Originally Posted by yoyoyoyo (Post 1374628)
thanks for the update

No problem - it should have been there in the first place ;) - I'm surprised it wasn't brought up sooner, tbh.

powerful_rogue 11-06-2007 02:09 PM

Hi,

Kind of managed to get it working!

If you search via the drop down box (google or my site) it comes back with the following error:

1. Please specify some words or valid user names to search on. There were no matches for those that you specified.

However, If I search via the search.php page it works fine!

Any sugegstions at all?

powerful_rogue 11-06-2007 07:50 PM

One more question!

Would it be possible to create a vbadvance module that shows the google search box? When people search using it they are then taken to the searchresults.php page. Ive tried to have a play around but could seem to get it to work.

davidw 11-06-2007 10:26 PM

I actually have a vbadvanced version at vbadvanced.com (I guess I could release it here).

http://www.vbadvanced.com/forum/showthread.php?p=82852 and also post 3 - I've not updated it in a while but is still usable (just needing a couple modifications to it).

davidw 11-06-2007 10:31 PM

Quote:

Originally Posted by powerful_rogue (Post 1377004)
Hi,

Kind of managed to get it working!

If you search via the drop down box (google or my site) it comes back with the following error:

1. Please specify some words or valid user names to search on. There were no matches for those that you specified.

However, If I search via the search.php page it works fine!

Any sugegstions at all?

Can you tell me your website so I can see what is going on?

powerful_rogue 11-06-2007 10:33 PM

Hi,

Thanks for the reply :)

My site is www.DoverLocals.co.uk

Also without wishing to be a pain, is there anyway to reduce the amount of space after the results. Ive attached an image to show you.

Thanks

Dave

davidw 11-06-2007 10:59 PM

As far as the "whitespace" below the results, that can't (currently) be altered at the moment due to the code Google supplied (unalterable iframe height). However, I am always on the lookout for new code so that this can be improved.

Looking at your site, you are using a version of vB that may not take full advantage of the full version of the code (as I have noticed with another member who had a similar issue as you). After looking into it, it was discovered that the legacy version worked best.

Which version are you using? Have you tried using the legacy version?

powerful_rogue 11-07-2007 10:40 AM

Im currently using the 1.3 legacy version. I also made all the alterations in the first post.

davidw 11-07-2007 10:59 AM

Can you PM me the section of code that pertains to this in your navbar? Also a temp login account to see what is going on as clicking on search just takes me to search.php. I will be back tonight (I work during the days).

oldengine 11-07-2007 08:27 PM

I notice in your screen shot that the Google results are crowded up against the left hand side of the white background. I think that the previous hack by someone else did this also, but is there any margin value capability? Maybe an extra white table around it?

Great hack by the way! I just installed it and after adding an extra 1 to the GALT it works. With only 1 as in my google code, it returns an empty result screen.

I am on 3.6.8 and it's also working on the current versions of PhotoPost vBGallery and vBAdvanced Links.

Does anyone know the reason for GAULT 1 or 11 ?

davidw 11-08-2007 10:28 PM

Quote:

Originally Posted by oldengine (Post 1377999)
I notice in your screen shot that the Google results are crowded up against the left hand side of the white background. I think that the previous hack by someone else did this also, but is there any margin value capability? Maybe an extra white table around it?

That's something that is currently out of my control as it is set in an iFrame controlled by Google. Hopefully in a later release, that can be fixed.

Quote:

Originally Posted by oldengine (Post 1377999)
Great hack by the way! I just installed it and after adding an extra 1 to the GALT it works. With only 1 as in my google code, it returns an empty result screen.

I am on 3.6.8 and it's also working on the current versions of PhotoPost vBGallery and vBAdvanced Links.

Does anyone know the reason for GAULT 1 or 11 ?

I'm not sure, but I think the difference between the 1 and the 11 is how the code is processed.

I do appreciate the compliments. In the future I will add more flexibility in a phase-in/phase-out period as I did with previous versions.

powerful_rogue 11-09-2007 05:11 PM

Quote:

Originally Posted by davidw (Post 1377355)
I actually have a vbadvanced version at vbadvanced.com (I guess I could release it here).

http://www.vbadvanced.com/forum/showthread.php?p=82852 and also post 3 - I've not updated it in a while but is still usable (just needing a couple modifications to it).

Ive installed this module and it works a treat :)

Is there anyway though for it to bring up the results in the searchresults.php page?

Raffaele 11-09-2007 07:07 PM

Hi David,

i got the pub but where do you get the GALT at the adsence site??

Thank you for the help
RV

powerful_rogue 11-09-2007 07:27 PM

Once google has generated the search code - you can locate the GALT in that.

davidw 11-09-2007 09:55 PM

Quote:

Originally Posted by powerful_rogue (Post 1379163)
Ive installed this module and it works a treat :)

Is there anyway though for it to bring up the results in the searchresults.php page?

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.

davidw 11-09-2007 09:57 PM

Quote:

Originally Posted by Raffaele (Post 1379230)
Hi David,

i got the pub but where do you get the GALT at the adsence site??

Thank you for the help
RV

If you don't find the GALT you can use what I have at the top of the thread.

Don't forget to click Install :)

powerful_rogue 11-09-2007 10:53 PM

Quote:

Originally Posted by davidw (Post 1379332)
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?

davidw 11-09-2007 11:50 PM

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

The_Gun_Man 11-10-2007 01:33 AM

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.

davidw 11-10-2007 02:10 AM

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 :)

powerful_rogue 11-10-2007 08:25 AM

Quote:

Originally Posted by davidw (Post 1379381)
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

powerful_rogue 11-10-2007 08:50 AM

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?

davidw 11-10-2007 02:44 PM

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.

davidw 11-10-2007 03:20 PM

Quote:

Originally Posted by psychotronic (Post 1374757)
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).

davidw 11-10-2007 04:18 PM

Ok, I have a working prototype on my site now :)
Edit: I have updated the modification to add the vbadvanced (version 1.4).

powerful_rogue 11-10-2007 07:54 PM

Thanks for the update :D

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.


All times are GMT. The time now is 01:04 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.01545 seconds
  • Memory Usage 1,887KB
  • 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
  • (14)bbcode_code_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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