vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Integration with vBulletin - Replace search with Google Custom Search (https://vborg.vbsupport.ru/showthread.php?t=229247)

SemperFideles 12-24-2010 07:34 PM

Quote:

Originally Posted by Inferno Dragon (Post 2138686)
I have added this modification on my members request and it's working fine however it's not displaying any search result..I always gets:



I tried many keywords but it's not working :S

my search site URL in google adsense is: www.pakgamers.com/forums
and search results page URL is: http://www.pakgamers.com/forums/google.php

Have you followed these steps: https://vborg.vbsupport.ru/showpost....5&postcount=36

Ensure you replace with your own URL and Google code....

steveneff 12-25-2010 05:48 AM

Quote:

Originally Posted by SemperFideles (Post 2103283)
For future reference, what is replaced in the navbar template is everything between the form tags. For vb 4.0.7, look for this code:

Code:

                <form action="search.php?{vb:raw session.sessionurl}do=process" method="post" id="navbar_search" class="navbar_search">
                        <vb:comment><input type="hidden" name="s" value="{vb:raw session.sessionurl}" /></vb:comment>
                        <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
                        <input type="hidden" name="do" value="process" />
                        <span class="textboxcontainer"><span><input type="text" value="" name="query" class="textbox" tabindex="99"/></span></span>
                        <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.<vb:if condition="(is_browser('ie') AND !is_browser('ie', 7) AND !is_browser('ie', 8))">gif<vb:else />png</vb:if>" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span>
                </form>

Replace with:
Code:

        <form action="http://www.puritanboard.com/google.php" id="cse-search-box">
    <input type="hidden" name="cx" value="partner-pub-XXXXX:XXXX" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
            <span class="textboxcontainer"><span><input type="text" value="" name="q" class="textbox" /></span></span>
            <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="sa" onclick="document.getElementById('navbar_search').submit;" />  </span></span>
        </form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>

Replace the partner-pub code with the code you get from setting up your custom search.

Top mod. Installed on 4.07 using this simple single edit.

I guess using this mod will cut down on database use from some of those unwanted spiders but will it have an effect on SEO with the main search engines?

BaanFarsang 12-25-2010 11:11 AM

Not compatible with vBulletin ™ Patch Level 2 Version 4.1.0, you write the method with this version?
I have just 16 digits's pub from google.

Inferno Dragon 12-25-2010 03:50 PM

Quote:

Originally Posted by SemperFideles (Post 2138732)
Have you followed these steps: https://vborg.vbsupport.ru/showpost....5&postcount=36

Ensure you replace with your own URL and Google code....

Hi,

Yes I did, that's why I said it's working fine but for some weird reasons it's not displaying the search results i-e for any keyword it just display "no results found etc)

EDIT: OK, it's working fine now, I changed the domain settings in the adsense and removed the "www." part.

greenchicken 12-28-2010 01:44 PM

Quote:

Originally Posted by SemperFideles (Post 2103283)
For future reference, what is replaced in the navbar template is everything between the form tags. For vb 4.0.7, look for this code:

Code:

                <form action="search.php?{vb:raw session.sessionurl}do=process" method="post" id="navbar_search" class="navbar_search">
                        <vb:comment><input type="hidden" name="s" value="{vb:raw session.sessionurl}" /></vb:comment>
                        <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
                        <input type="hidden" name="do" value="process" />
                        <span class="textboxcontainer"><span><input type="text" value="" name="query" class="textbox" tabindex="99"/></span></span>
                        <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.<vb:if condition="(is_browser('ie') AND !is_browser('ie', 7) AND !is_browser('ie', 8))">gif<vb:else />png</vb:if>" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span>
                </form>

Replace with:
Code:

        <form action="http://www.puritanboard.com/google.php" id="cse-search-box">
    <input type="hidden" name="cx" value="partner-pub-XXXXX:XXXX" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
            <span class="textboxcontainer"><span><input type="text" value="" name="q" class="textbox" /></span></span>
            <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="sa" onclick="document.getElementById('navbar_search').submit;" />  </span></span>
        </form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>

Replace the partner-pub code with the code you get from setting up your custom search.

This worked for me , thank you and thank you for your service.

SemperFideles 12-28-2010 01:57 PM

Quote:

Originally Posted by BaanFarsang (Post 2138878)
Not compatible with vBulletin ? Patch Level 2 Version 4.1.0, you write the method with this version?
I have just 16 digits's pub from google.

It's compatible with all versions of vBulletin 4.x. I have 4.1.0 PL2 installed and it is working fine. Fundamentally, there's really a form that's being changed inside the navbar template and, no matter how much the navbar changes with each release, the form code that controls the functioning of Google search really remains the same.

SemperFideles 12-28-2010 02:03 PM

Quote:

Originally Posted by steveneff (Post 2138823)
I guess using this mod will cut down on database use from some of those unwanted spiders but will it have an effect on SEO with the main search engines?

I don't see how it could affect SEO. It certainly does cut down on database use not only from spiders but from users. It also produces much more relevant search results.

mikeinjersey 12-28-2010 06:23 PM

can we make money with this....if so how ? Only if people click on the sponsored links ?

SemperFideles 12-28-2010 06:45 PM

Quote:

Originally Posted by mikeinjersey (Post 2140268)
can we make money with this....if so how ? Only if people click on the sponsored links ?

Yes, if people click on the sponsored links. It's really not a whole lot of money unless your site specializes in areas that have valuable keywords. Mine does not and I make a small amount of money from sponsored links but it's not the reason I installed the mod.

mikeinjersey 12-28-2010 07:20 PM

Quote:

Originally Posted by SemperFideles (Post 2140277)
Yes, if people click on the sponsored links. It's really not a whole lot of money unless your site specializes in areas that have valuable keywords. Mine does not and I make a small amount of money from sponsored links but it's not the reason I installed the mod.

I dont have the mod installed, but I was thinking of just allowing Google results within the Search...and no results from my site. (to increase sponsored links possibilities)

Is it possible like that ? (i'm guessing the options just need to be set correctly in the Google Adsense area)

SemperFideles 12-28-2010 08:31 PM

Quote:

Originally Posted by mikeinjersey (Post 2140290)
I dont have the mod installed, but I was thinking of just allowing Google results within the Search...and no results from my site. (to increase sponsored links possibilities)

Is it possible like that ? (i'm guessing the options just need to be set correctly in the Google Adsense area)

You're not going to increase sponsored links possibilities that way. You can set up custom search to search google.com but that would defeat the purpose of having a site search. You can focus sponsored links when you set up custom search by adding certain keywords in the Site Search setup at Adsense for Search.

vbcreator 01-03-2011 10:28 AM

thanks , gonna test it

ThisIrksMe 01-04-2011 09:08 PM

I got the script you posted installed in my navbar template. I still get a white screen. Thanks for your help sir. SGT Larson US Army, USMC Vet

just77me 01-04-2011 10:26 PM

added a empty google.php file to the forum when searching something getting a white page withour the google.php it works but opens without forum on a new page - any ideas pleasE?

Winter Sonata 01-17-2011 12:30 AM

What is the problem might me when I got this error

Quote:

Warning: require_once(./global.php) [function.require-once]: failed to open stream: No such file or directory in /home/lass/public_html/langatr/google.php on line 29

Fatal error: require_once() [function.require]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/lass/public_html/langatr/google.php on line 29

?

BaanFarsang 01-18-2011 05:16 AM

1 Attachment(s)
I tried to solve problems in vb4.1.1 following by step:

- Find in the navbar template for this code:

Code:

<form action="search.php?{vb:raw session.sessionurl}do=process" method="post" id="navbar_search" class="navbar_search">
  <vb:comment><input type="hidden" name="s" value="{vb:raw session.sessionurl}" /></vb:comment>
  <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
  <input type="hidden" name="do" value="process" />
  <span class="textboxcontainer"><span><input type="text" value="" name="query" class="textbox" tabindex="99"/></span></span>
  <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.<vb:if condition="(is_browser('ie') AND !is_browser('ie', 7) AND !is_browser('ie', 8))">gif<vb:else />png</vb:if>" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span>
  </form>

Replace with:

Code:

<form action="http://www.yoursite.com/google.php" id="cse-search-box">
    <input type="hidden" name="cx" value="xxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxx" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="utf-8" />
            <span class="textboxcontainer"><span><input type="text" value="" name="q" class="textbox" /></span></span>
            <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.<vb:if condition="(is_browser('ie') AND !is_browser('ie', 7) AND !is_browser('ie', 8))">gif<vb:else />png</vb:if>" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span>
                </form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=th"></script>

* http://www.yoursite.com/google.php=Replace with your site
* xxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxx=your Google AdSense Publisher ID

Demo: http://www.baanfarsang.com

Gn_Snake 02-01-2011 07:08 PM

Not Work with vb 4.1.1 ??

SemperFideles 02-01-2011 11:23 PM

Quote:

Originally Posted by Gn_Snake (Post 2157470)
Not Work with vb 4.1.1 ??

Works just fine. All this does is replace a form in the Navbar. The only thing that will change in major versions hereafter is the template for a page but that will be a while.

Gn_Snake 02-02-2011 10:59 AM

If I put a word in the search field gives me a blank page.
Why?

Thx

scottct1 02-03-2011 01:16 PM

Works great... now only if I could figure how to add some skyscraper ads on the left hand side it would be PERFECT!

Gn_Snake 02-07-2011 10:55 AM

Nothing? Any idea for blank page in Google Search?

SemperFideles 02-07-2011 12:19 PM

Quote:

Originally Posted by Gn_Snake (Post 2159725)
Nothing? Any idea for blank page in Google Search?

You implemented it incorrectly. I've provided step-by-step instructions in post #36.

fxwoody 02-08-2011 09:16 AM

Tks guys , i will give it a try!

Tho if i got all this right, after doing all the mods, it should take around 10 min for crawler to get on and board should be fully visible ! Right?

SemperFideles 02-08-2011 09:23 AM

Quote:

Originally Posted by fxwoody (Post 2160121)
Tks guys , i will give it a try!

Tho if i got all this right, after doing all the mods, it should take around 10 min for crawler to get on and board should be fully visible ! Right?

This mod doesn't cause Google to crawl your site but relies on the fact that it probably already has.

fxwoody 02-08-2011 11:48 PM

tks for the info! after playing around this for 2hr +++ i found out the my template was "google" instead of "GOOGLE" lolll big difference to get it to work! lolll

Tks guys! Will see how it turns out for the $$$ now with this lolll ;)

Just one last thing, didn't search for it yet but, when i make a search, i automatically log off?? Any suggestions :)

Tks

David Karol 02-11-2011 06:44 AM

Great mod!

Is it possible to change the height of the google search box, to be more like the original vB box? See soundforums.net

prandah 03-21-2011 09:05 AM

how to get
partner public google id ?

SemperFideles 03-21-2011 04:12 PM

Go to Google Adsense.

prandah 03-21-2011 07:34 PM

I don't have google adsense :(
i'm submit google adsense allways rejected :(

anyone can help me for google adsense :D

SemperFideles 03-21-2011 08:05 PM

Quote:

Originally Posted by prandah (Post 2175912)
I don't have google adsense :(
i'm submit google adsense allways rejected :(

anyone can help me for google adsense :D

I just checked and it will work without the partner-pub if you remove this line from your navbar template:
PHP Code:

    <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxx:xxxxxx-xxxx" /> 

You obviously won't get any revenue from Adsense for Search but it will help reduce server load.

prandah 03-22-2011 09:41 AM

okey thanks semper
it's work :D

mark installed :D

ymcus 03-23-2011 07:16 AM

In style manager and in my required template i did'nt find the the template navbar
please help meeeeeeeeeeeeeeeeeeeeee

SemperFideles 03-23-2011 08:34 AM

It's one of the templates grouped under Navigation Breadcrumb or something like that.

ijob 03-29-2011 03:52 PM

Is there any uptodate code to implement this on the latest vbulletin? I cant seem to get the original code in the op to work.

SemperFideles 03-29-2011 04:04 PM

Quote:

Originally Posted by ijob (Post 2178762)
Is there any uptodate code to implement this on the latest vbulletin? I cant seem to get the original code in the op to work.

There's nothing to update for the most recent vBulletin version. It works fine.

DNN 04-19-2011 03:12 AM

can't one just install the general adsense for search code directly as is from their adsense account?

deverill2010 04-22-2011 08:23 PM

I can't get this to work on my site.

I am trying to make the template changes but the code I have in my templates is slightly different to what is listed here.

When I save I get this error -

The following error occurred when attempting to evaluate this template:
Invalid Tag Nesting
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

And the search box dispaears?

deverill2010 05-02-2011 04:53 PM

Anyone?

Breakpoint 05-05-2011 10:12 PM

I would suggest you copy everything that is posted on Page 3

deverill2010 05-06-2011 08:18 PM

Quote:

Originally Posted by Breakpoint (Post 2192460)
I would suggest you copy everything that is posted on Page 3

That is really helpful thank you!

I now have it working :)

The only thing is how do I remove the advert box?

I only see 3 options in my adsense which are -

Top and right
Top and bottom
Right

Theres no option to completely remove it. I only want the search results to show?

thanks


All times are GMT. The time now is 02:34 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.01415 seconds
  • Memory Usage 1,851KB
  • 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
  • (6)bbcode_code_printable
  • (1)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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