vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Add-On Releases - Google/Adsense Site Search Navbar Integration (https://vborg.vbsupport.ru/showthread.php?t=128274)

davidw 10-03-2006 10:00 PM

Google/Adsense Site Search Navbar Integration
 
Since the vbadvanced google/adsense integration I came out with a while back I had wanted to think of a way to do this to the navbar, but I didn't really care for the old navbar's search - until the 3.6 version came out. I like this new version and I've now decided to come write my own based on what I did with my original for vbadvanced.

It's fairly simple...

Go to your admincp => Styles & Templates => Style Manager => look for your style to do this to and under All Style Options click Edit Templates

In your navigation bar, find

Code:

<!-- header quick search form -->
        <div class="vbmenu_popup" id="navbar_search_menu" style="display:none">
                <table cellpadding="4" cellspacing="1" border="0">
                <tr>
                        <td class="thead">$vbphrase[search_forums]</td>
                </tr>
                <tr>
                        <td class="vbmenu_option" title="nohilite">
                                <form action="search.php?do=process" method="post">
                                        <input type="hidden" name="do" value="process" />
                                        <input type="hidden" name="quicksearch" value="1" />
                                        <input type="hidden" name="childforums" value="1" />
                                        <input type="hidden" name="exactname" value="1" />
                                        <input type="hidden" name="s" value="$session[sessionhash]" />
                                        <div><input type="text" class="bginput" name="query" size="25" tabindex="1001" /><input type="submit" class="button" value="$vbphrase[go]" tabindex="1004" /></div>
                                        <div style="margin-top:$stylevar[cellpadding]px">
                                                <label for="rb_nb_sp0"><input type="radio" name="showposts" value="0" id="rb_nb_sp0" tabindex="1002" checked="checked" />$vbphrase[show_threads]</label>
                                                &nbsp;
                                                <label for="rb_nb_sp1"><input type="radio" name="showposts" value="1" id="rb_nb_sp1" tabindex="1003" />$vbphrase[show_posts]</label>
                                        </div>                                       
                                </form>
                        </td>
                </tr>
                <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]
                </table>
        </div>
        <!-- / header quick search form -->

and replace with

Code:

<!-- header quick search form -->
        <div class="vbmenu_popup" id="navbar_search_menu" style="display:none">
                <table cellpadding="4" cellspacing="1" border="0">
                <tr>
                        <td class="thead">$vbphrase[search_forums]</td>
                </tr>
                <tr>
                        <td class="vbmenu_option" title="nohilite">
                                <form action="search.php?do=process" method="post">
                                        <input type="hidden" name="do" value="process" />
                                        <input type="hidden" name="quicksearch" value="1" />
                                        <input type="hidden" name="childforums" value="1" />
                                        <input type="hidden" name="exactname" value="1" />
                                        <input type="hidden" name="s" value="$session[sessionhash]" />
                                        <div><input type="text" class="bginput" name="query" size="25" tabindex="1001" /><input type="submit" class="button" value="$vbphrase[go]" tabindex="1004" /></div>
                                        <div style="margin-top:$stylevar[cellpadding]px">
                                                <label for="rb_nb_sp0"><input type="radio" name="showposts" value="0" id="rb_nb_sp0" tabindex="1002" checked="checked" />$vbphrase[show_threads]</label>
                                                &nbsp;
                                                <label for="rb_nb_sp1"><input type="radio" name="showposts" value="1" id="rb_nb_sp1" tabindex="1003" />$vbphrase[show_posts]</label>
                                        </div>                                       
                                </form>
                        </td>
                </tr>
                <tr>
                        <td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a></td>
                </tr>
                <tr>
                        <form action="http://www.google.com/custom" type="hidden" method=GET name="search"><td class="thead">Search Site / Google</td>
                </tr>
                <tr>
                        <td class="vbmenu_option" title="nohilite">
                        <input type="hidden" name="client" value="pub-0252500186462625">
                        <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:#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">
                        <input name="domains" type="hidden" value="www.yoursite.com">
                        <input type="hidden" name="hl" value="en">
                        <input type="text" class="bginput" name="q" size="25" maxlength="255" />$gobutton<br />
                        <input name="sitesearch" type="radio" value="www.christianboards.org" checked> Christianboards.org<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>
                        </td></form>
                </tr>
                $template_hook[navbar_search_menu]
                </table>
        </div>
        <!-- / header quick search form -->

Replace pub-1234567890123456 with your pub- number
In the line <input name="cof" type="hidden" value="GALT:">, Replace value="GALT:" with your information (this contains information that controls how your search results are displayed - this won't necessarily start with GALT:).
Replace www.yoursite.com with your website in both places
Replace Yoursite.com with your website

I have updated this for 3.6.7 - there is a small change, but enough for an update.
There is a hook as well, $template_hook[navbar_search_menu], which I have a product that you can just install, but for some reason ibproarcade is conflicting with this new product.

dieselpowered 10-04-2006 04:54 PM

WOOHOO I am first!

dieselpowered 10-04-2006 04:58 PM

LOL spoke too soon...what is GALT? :)

davidw 10-04-2006 05:01 PM

It looks something like this:
Code:

GALT:#9A2C06;GL:1;DIV:#33FFFF;VLC:D03500;AH:center;BGC:99CCFF;LBGC:CCE5F9;ALC:440066;LC:440066;T:336699;GFNT:223472;GIMP:223472;FORID:1;
I'm not sure exactly what it is used for, or if it is directly related to the adsense (or if it is just part of the form).

dieselpowered 10-04-2006 05:06 PM

Quote:

Originally Posted by christianb
It looks something like this:
Code:

GALT:#9A2C06;GL:1;DIV:#33FFFF;VLC:D03500;AH:center;BGC:99CCFF;LBGC:CCE5F9;ALC:440066;LC:440066;T:336699;GFNT:223472;GIMP:223472;FORID:1;
I'm not sure exactly what it is used for, or if it is directly related to the adsense (or if it is just part of the form).

Ahhhh there it is...thanks, looks great!

davidw 10-04-2006 05:07 PM

Don't forget to click install :D

Edit, now that I think about it - I believe it has everything to do with what the page looks like when you click the Go button - on the search results.

GoTTi 10-04-2006 06:34 PM

i have a custom style and when i put the code in the navbar it doesnt show up.

this isnt the only time this has happend. i think something is not letting me edit the search drop down in this 1 style. any ideas where i can look to edit the search field?

davidw 10-04-2006 07:09 PM

it may be in your header - I've had styles that did that before.

mattyk72 10-04-2006 07:19 PM

very nice, thanks!

Endurer 10-04-2006 09:02 PM

Thank you so much Christianb. :)

GoTTi 10-04-2006 10:36 PM

Quote:

Originally Posted by christianb
it may be in your header - I've had styles that did that before.

thats where it was. thanks.

Greek76 10-05-2006 08:32 AM

I installed the hack works great but what is the GALT and where do I find it?

davidw 10-05-2006 09:29 AM

Months ago, when I first signed on to the Google Adsense for search [ those who have never used Google Adsense - here's a link - https://www.google.com/adsense/ws-overview ], it went through a wizard (one part was a customization of the display on how things looked whenever someone used the search feature) and when I was done it gave me several items including the GALT - seeing how the galt contains hex figures, I assume this controls how your search displayed results look once the search is completed. The original adsense for search code you received should have this information, however if it doesn't feel free to use what I have and modify it for your own. As long as you have your own adsense information for your revenue, that is what matters.

Now that I think about it, it probably isn't even called GALT, but its just that mine started with that. :)

This may also help: https://www.google.com/support/adsen...f&topic=&type=

gauravseth 10-06-2006 03:11 PM

*Installed*

Nice hack

ang2el 10-10-2006 02:56 AM

Seems like a nice hack.

Quote:

Originally Posted by christianb
=> Styles & Templates => Style Manager => look for your style to do this to and under All Style Options click Edit Style Options

then where to go... I just stucked after this because

Edit Syles Options conatins
Edit Setting
Add Child styles
Download
Delete style

wjkids 10-10-2006 04:17 AM

Awesome Mod - Installed 3.6.2 - Thank you!

davidw 10-10-2006 12:21 PM

Quote:

Originally Posted by ang2el
Seems like a nice hack.



then where to go... I just stucked after this because

Edit Syles Options conatins
Edit Setting
Add Child styles
Download
Delete style

I'm sorry, I need to change that...

It should be:
=> Styles & Templates => Style Manager => look for your style to do this to and under All Style Options click Edit Templates

nymyth 10-10-2006 05:53 PM

UPDATE: No Matter it works....NICE MOD

Peace

davidw 10-10-2006 06:33 PM

In the google search or in the regular search part?

nymyth 10-10-2006 06:35 PM

^^i got it fixed, i forgot to end the form for the thread search part.....all good now....

Cheers

davidw 10-10-2006 08:22 PM

That's good - don't forget to hit install :)

cuphongle 10-12-2006 06:02 PM

Beautiful, thanks

BigJimTheLug 01-05-2007 10:04 PM

I installed this hack and lost functioning in the "Go" button.
However, the advanced feature works.

Is there any way to fix the "Go" button?

Please help thanks.

davidw 01-06-2007 06:20 PM

Quote:

Originally Posted by MARKETPROFITS (Post 1151617)
I installed this hack and lost functioning in the "Go" button.
However, the advanced feature works.

Is there any way to fix the "Go" button?

Please help thanks.

To be honest, I'm not sure - Both Go buttons work fine on my site, so I'm not sure why this is limiting the function on the one Go button on yours.

BigJimTheLug 01-08-2007 07:10 PM

Hmm........alrighty.

Thanks.

Any idea where I can start looking to hopefully address the problem?

The problem is annoying because it is isolated to only the "Go" button.

Should I start in the navbar?/

davidw 01-08-2007 10:18 PM

Most likely it will reside in the navbar - do you have a test account I can look at to see how it functions on your site?

BigJimTheLug 01-10-2007 04:36 AM

Hey, you were right. The problem was in the Navbar. I fixed it!

It works great now and so does this hack, I love the increased earnings.

This is the code I used to repair it:

PHP Code:

<if condition="$show['searchbuttons']">
    <!-- 
header quick search form -->
    <
div class="vbmenu_popup" id="navbar_search_menu" style="display:none">
        <
form action="search.php?do=process" method="post">
        <
table cellpadding="4" cellspacing="1" border="0">
        <
tr>
            <
td class="thead">$vbphrase[search_forums]</td>
        </
tr>
        <
tr>
            <
td class="vbmenu_option" title="nohilite">
                <
input type="hidden" name="do" value="process" />
                <
input type="hidden" name="quicksearch" value="1" />
                <
input type="hidden" name="childforums" value="1" />
                <
input type="hidden" name="exactname" value="1" />
                <
input type="hidden" name="s" value="$session[sessionhash]/>
                <
div><input type="text" class="bginput" name="query" size="25" tabindex="1001" /><input type="submit" class="button" value="$vbphrase[go]tabindex="1004" /></div>
            </
td>
        </
tr


How do I create a test account?

davidw 01-10-2007 11:37 AM

You won't have to now, since you fixed it - but if you ever do, just go to your admincp => Users => Add new user

John W Smith 01-23-2007 10:01 PM

I don't want to have the option to search my site as it just a board and the vB search does that. How would I change the "Search Site/Google" title to just "Search Google" and remove the radio button choice of "my site" and "Google"?

davidw 01-23-2007 11:52 PM

Try this

PHP Code:

<!-- header quick search form -->
<
div class="vbmenu_popup" id="navbar_search_menu" style="display:none">
    <
table cellpadding="4" cellspacing="1" border="0">
    <
tr>
        <
form action="search.php?do=process" method="post"><td class="thead">$vbphrase[search_forums]</td>
    </
tr>
    <
tr>
        <
td class="vbmenu_option" title="nohilite">
            <
input type="hidden" name="do" value="process" />
            <
input type="hidden" name="quicksearch" value="1" />
            <
input type="hidden" name="childforums" value="1" />
            <
input type="hidden" name="exactname" value="1" />
            <
input type="hidden" name="s" value="$session[sessionhash]/>
            <
div><input type="text" class="bginput" name="query" size="25" tabindex="1001" /><input type="submit" class="button" value="$vbphrase[go]tabindex="1004" /></div>
        </
td>
    </
tr>
    <
tr>
        <
td class="vbmenu_option" title="nohilite">
            <
label for="rb_nb_sp0"><input type="radio" name="showposts" value="0" id="rb_nb_sp0" tabindex="1002" checked="checked" />$vbphrase[show_threads]</label>
            &
nbsp;
            <
label for="rb_nb_sp1"><input type="radio" name="showposts" value="1" id="rb_nb_sp1" tabindex="1003" />$vbphrase[show_posts]</label>
        </
td>
    </
tr>
    <
tr>
        <
td class="vbmenu_option"><a href="search.php$session[sessionurl_q]accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a></td></form>
    </
tr>
    <
tr>
        <
form action="http://www.google.com/custom" type="hidden" method=GET name="search"><td class="thead">Search Google</td>
    </
tr>
    <
tr>
        <
td class="vbmenu_option" title="nohilite">
            <
input type="hidden" name="client" value="pub-1234567890123456">
            <
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 type="hidden" name="hl" value="en">
            <
input type="text" class="bginput" name="q" size="25" maxlength="255" />$gobutton<br />
            </
td></form>
    </
tr>
    </
table>
</
div>
<!-- / 
header quick search form --> 


Eagle Creek 02-12-2007 11:31 PM

What does this have to do with google adsense? I mean? It's just a google search performed on your site, isn't it?

davidw 02-13-2007 12:09 AM

You could look at it that way, however, you have both options - search your site OR search the web with your adsense information. Adsense does not have to be a box with ads in it. This is called Adsense for Search.

Here's an overview: https://www.google.com/adsense/ws-overview

Eagle Creek 02-13-2007 02:06 AM

Aah, now I get it ;).
I thought of the box with ads yes :D.

And where do I find the GELT?

davidw 02-13-2007 12:29 PM

the GALT, from what I understand is how the results display on your page. Much like properties of <td> and <div> tags, it appears to define the properties. It is displayed initially when you sign up for the adsense code. For example, here is mine
PHP Code:

GALT:#9A2C06;GL:1;DIV:#33FFFF;VLC:D03500;AH:center;BGC:99CCFF;LBGC:CCE5F9;ALC:440066;LC:440066;T:336699;GFNT:223472;GIMP:223472;FORID:1; 

broken down, it looks like this:
PHP Code:

GALT:#9A2C06;
GL:1;DIV:#33FFFF;
VLC:D03500;
AH:center;
BGC:99CCFF;
LBGC:CCE5F9;
ALC:440066;
LC:440066;
T:336699;
GFNT:223472;
GIMP:223472;
FORID:1

I just went to https://www.google.com/adsense/search-settings, played around with the colors, etc., and it produced new code for me including new information for that line
PHP 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;LH:50;LW:250;L:http://www.christianboards.org/images/logo.gif;S:http://www.christianboards.org;FORID:1 


Eagle Creek 02-14-2007 12:46 AM

Aah... So I really do need an adsense account?

davidw 02-14-2007 02:17 AM

Yes, to make money off the searches (you need the pub-#). Of course, you could always use mine :P

RedGTiVR6 02-16-2007 11:28 AM

What if making money off of the searches isn't necessarially a concern?

If I just wanted a google search feature for the forum. Is that possible with this mod or do I need to look elsewhere?

Eagle Creek 02-16-2007 12:24 PM

Quote:

Originally Posted by RedGTiVR6 (Post 1183796)
What if making money off of the searches isn't necessarially a concern?

If I just wanted a google search feature for the forum. Is that possible with this mod or do I need to look elsewhere?

Exactly..

davidw 02-16-2007 12:31 PM

This works either way :) If you just wanted to search the site rather than search the web, you could remove the ability to search the web. (the radio button).

Edit:

Find:
PHP Code:

<form action="http://www.google.com/custom" type="hidden" method=GET name="search"><td class="thead">Search Site Google</td

Replace with:
PHP Code:

<form action="http://www.google.com/custom" type="hidden" method=GET name="search"><td class="thead">Search Site</td

Then

Find and Remove:
PHP Code:

<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

This should work, although I've not tested it.

RedGTiVR6 02-16-2007 01:24 PM

So then this would just allow a google style search on the site it's self. No need to have an ad sense account?

If so, this would probably end up working much better. We're finding that the search feature that's built in doesn't work very well.


All times are GMT. The time now is 06:31 AM.

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.02018 seconds
  • Memory Usage 1,925KB
  • 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
  • (4)bbcode_code_printable
  • (8)bbcode_php_printable
  • (6)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