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)
-   -   Integration with vBulletin - CFM: Google AdSense for Search Integration (https://vborg.vbsupport.ru/showthread.php?t=125721)

Throtex 09-02-2006 10:00 PM

CFM: Google AdSense for Search Integration
 
Title: "CFM: Google Search Results"
-------------------------------------------------
Author: Sal Bezos (webmaster@carforummisfits.com)
Date of Creation: September 3, 2006
Version: 1.0 (9/30/2006)
Home: http://www.carforummisfits.com/
-------------------------------------------------

Purpose:
--------
This product for vBulletin creates a target page for providing Google Search Results within your vBulletin forums. The Google Search Results (AdSense for Search) will appear in a vBulletin page.

Unlike the previous revision of this product, you will now be able to enter code for a Google Search Box for placement in the Search drop-down menu (or anywhere else you would like to place it). Please make sure that your search box code includes a <form> tag that states something along the lines of action="http://<yourhostname>/forums/cfmgoogle.php".


Tested:
-------
This product has been tested on a vBulletin 3.6.1 installation. There is no reason why it should not work in the same manner on any 3.6.x or 3.5.x installation, but it has not and will not be tested by the author.


Included Files:
---------------
- README.txt
- cfm-live-demo.png (screenshot)
- cfmgoogle.php
- product-cfm_google_search_results.xml


Installation:
-------------
1. Upload the cfmgoogle.php file to your forum root, usually located at http://<yourhostname>/forums.

2. Register for a Google AdSense for Search account.
----a. Register for a Google AdSense account if you don't have one.
----b. Visit "http://www.google.com/adsense/".
----c. Login with your e-mail and password.
----d. Click on the "AdSense Setup" tab.
----e. Select "AdSense for Search".
----f. Configure your search box.
--------f1. Select either "Google WebSearch" or "Google WebSearch + SiteSearch" depending on whether you want users to be able to Google search your site or not. If you select "Google WebSearch + SiteSearch", enter the URL of sites you wish to be able to search.
--------f2. For Logo Type, I recomment selecting "Google Logo" and checking the "Logo above text box" option.
--------f3. For "Opening of search results page" select "Open results within my own site." Enter the URL of your cfmgoogle.php file (e.g. http://<yourhostname>/forums/cfmgoogle.php)
--------f4. Click "Continue >>".
----g. Configure the appearance of the results page, then click "Continue >>"
----h. You should now receive two sets of code from Google labeled "Your search box code" and "Your search results code".

3. In your forum's admin panel, go to Plugins & Products/Manage Products

4. Click on Add/Import Product

5. Click "Browse..." and select the "product-cfm_google_search_results.xml" product file. If this is your first installation of this product, select the "No" radio button in the "Allow Overwrite" option. If you are upgrading or reinstalling, select the "Yes" radio button. Click the "Import" button.

6. Go to vBulletin Options/vBulletin Options. Scroll through the list and select "CFM: Google Search Results".

7. In the "Google Search Box Code" option, paste the code provided by Google titled "Your search box code".

7. In the "Google Search Results Code" option, paste the code provided by Google titled "Your search results code".

8. In Styles & Templates/Style Manager go into Edit Templates for your style. Open the "Navigation / Breadcrumb Templates" template group and open the "navbar" template.

9. Find the following:
Code:

                <form action="search.php?do=process" method="post">
                <table cellpadding="4" cellspacing="1" border="0">

And replace with:
Code:

                <table cellpadding="4" cellspacing="1" border="0">
                <form action="search.php?do=process" method="post">

Find the following:
Code:

                </table>
                </form>
        </div>
        <!-- / header quick search form -->

And replace with:
Code:

                </form>
                <tr>
                        <td class="thead">Search Google</td>
                </tr>
                <tr>
                        <td class="vbmenu_option" title="nohilite">$vboptions[cfmgsr_googlesearch]</td>
                </tr>
                </table>
        </div>
        <!-- / header quick search form -->

10. Pull up a forum page and look under your search drop-down menu for the search box.

11. Enjoy!


FAQ:
----
Q. My search results window is too tall. What's wrong with it?
A. This appears to be a bug in the Google Search Results code. If my assumption is incorrect, please let me know.

Q. Why are the colors all wonky on my search results?
A. The colors of the search results are provided by the search box. Make sure the colors in the search box code are correct.

Q. The background color of the Google search box doesn't match my page -- what can I do about it?
A. If Google's TOS allows it, play around with the settings in the code you pasted in the "Your search box code" option.


Revisions:
----------
1.0 - 09/30/2006 - Adding instructions and support for the Google search box in the search drop-down menu
0.1 - 09/03/2006 - Initial release


Support:
--------
Any questions and problems should be reported to the modification's thread on http://www.vbulletin.org. No warranty, express or implied, is granted with this software. Use is at your own risk.


License:
--------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Throtex 09-03-2006 06:45 PM

Revision 1.0 of this product supports installation of the search box. The VB-savvy among you will quickly realize you can just take the $vboptions[cfmgsr_googlesearch] variable and place it wherever you like. The search drop-down menu integration is just an example.

--

Upgrading from 0.1 to 1.0: Just install the new product -- php file is identical to the old one.

Brandon Sheley 09-03-2006 06:48 PM

hows this different from the one that is already made just like this ?

Throtex 09-03-2006 06:53 PM

Quote:

Originally Posted by Loco.M
hows this different from the one that is already made just like this ?

I'm not sure which one in specific you're talking about, but this integrates the results page into your forum, rather than the search box.

What's the link to the other plugin?

Throtex 09-03-2006 06:58 PM

This is different from any of:
https://vborg.vbsupport.ru/showthread.php?t=103222
https://vborg.vbsupport.ru/showthread.php?t=116013
or
https://vborg.vbsupport.ru/showthread.php?t=104832

because this integrates the RESULTS page into the forum. You will need to use a hack like one of the aforementioned in order to create an integrated search box that will link to the integrated page in this hack.

WritersBeat 09-03-2006 06:59 PM

Thanks, looks interesting.

KevNJ 09-03-2006 08:10 PM

Just tried it on your site. I like it. Will be installing once I get home, Im currently at work and "working". hehe

Throtex 09-03-2006 08:15 PM

Quote:

Originally Posted by KevNJ
Just tried it on your site. I like it. Will be installing once I get home, Im currently at work and "working". hehe

Thanks!

voteforbird 09-03-2006 11:57 PM

Great add-on. Also, I was able to do it, but you may want to include directions about how to install the search form on the three floating DIV search boxes.

KevNJ 09-04-2006 12:26 AM

*clicks install*

works great. Just gotta make the drop down box more fluid to match the google search boxes.

Never used google adsense for search before... does it pay when someone does a search for something.. or after they do a search and click on a link from the results ?

Hakaslak 09-04-2006 12:52 AM

Nifty idea.

Is there a way to make it so that one search box pulls up both the Google results and your own site's results?

Hakaslak 09-04-2006 01:15 AM

Hmm... I figured it out how to place the Google Search bar like Throtex did in his preview picture.

IN NAVBAR FIND:

Code:

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

ADD BELOW:

Code:

      <tr>
        <td class="vbmenu_option">

<!-- GOOGLE CODE GOES HERE -->

      </td>
      </tr>

FINISH AND CLOSE.

Dunno if this is too simple to post, but just figured someone might ask eventually.

BTW - I code in Dreamweaver cause I'm a noob and like the code formatting feature and syntax highlighting, so my 'FIND' coding might be off. If anyone wants to tell me what the original code and spacing for the navbar was, I'd be glad to change my post.

KevNJ 09-04-2006 03:37 AM

Hakaslak - None of that coding is in my navbar. It must be the mod you installed for the google search feature itself.

voteforbird 09-04-2006 04:00 AM

Actually, if you do a Search in Templates for "search_menu" you'll see four templates. You'll want to modify FORUMDISPLAY, navbar and SHOWTHREAD to get all three relevant search boxes. Find the area with the popup DIV, copy the rows for the existing search form within it, and add another one directly below that's customized for the Google script.

You can make something like I have done at http://www.volconvo.com

bchertov 09-04-2006 04:09 AM

Ok. What's the point of having the search results in a vb page? If they click on any of the links they are outa there!

Hakaslak 09-04-2006 06:15 AM

That IS a good point... kinda counter intuitive...

Phooey 09-04-2006 12:36 PM

Works great, thanks! :up:


/installed

Throtex 09-04-2006 01:26 PM

Quote:

Originally Posted by bchertov
Ok. What's the point of having the search results in a vb page? If they click on any of the links they are outa there!

Not really any point I suppose ... though the ads that show up in the search results count for your AdSense payments. Plus you get one more bite at the apple to keep people on your site ... otherwise you'd send them directly to Google as soon as they run the search.

I just think it looks nice. :) I think this is a fairly recent offering by Google, so maybe more will be possible eventually. And of course, people are free to extend this in other ways.

Throtex 09-04-2006 01:29 PM

Quote:

Originally Posted by voteforbird
Great add-on. Also, I was able to do it, but you may want to include directions about how to install the search form on the three floating DIV search boxes.

I deliberately didn't add that because there are a number of other threads here on how to do that -- plus you guys figured it out anyway. ;) I just wanted to get straight to the meat of my product. :)

Hakaslak 09-04-2006 03:40 PM

Ahhh..

Well, I guess if they use the Google box, it's etter them them heading straight to Google.

My only concern is how to make sure they dont confuse the Google ebox for the real search box. >_<

Bulent Tekcan 09-04-2006 04:05 PM

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

Everytime I received this message.Any idea ?

Throtex 09-04-2006 04:18 PM

Quote:

Originally Posted by Hakaslak
Ahhh..

Well, I guess if they use the Google box, it's etter them them heading straight to Google.

My only concern is how to make sure they dont confuse the Google ebox for the real search box. >_<

Well, it can sorta work as a search box for your site if you run the Google search on your domain ... but as far as confusing the users, I think the way it looks on my site shouldn't confuse people -- though I suppose there might be better ways to eliminate confusion.

Throtex 09-04-2006 04:18 PM

Quote:

Originally Posted by Bulent Tekcan
Please specify some words or valid user names to search on. There were no matches for those that you specified.

Everytime I received this message.Any idea ?

I haven't seen that before, sorry. :(

Bulent Tekcan 09-04-2006 04:38 PM

Your sites working without any problems.What is your navbar settings ? I think wrong code in my navbar.Everytime open search in forum.

Bulent Tekcan 09-04-2006 05:19 PM

Finaly works now....

But I cannot find adjust for results.Every pages 10 result...Is this by design ?

Throtex 09-04-2006 05:58 PM

Quote:

Originally Posted by Bulent Tekcan
Finaly works now....

But I cannot find adjust for results.Every pages 10 result...Is this by design ?

That wouldn't be affected by my code -- it should support any changes that Google allows. That said, I don't think I've seen a setting to change the number of results on a page. I agree, it would be useful to have greater or fewer results per page to conform better to individual sites.

My understanding is that the search result integration feature is a fairly new offering from Google, and there are still a few glitches (like the height of the results not following the settings specified in the code you have to paste into the Admin CP options.

Google themselves actually provided all the integration code (for a target page) ... I just made it easier to integrate it with vBulletin. Unfortunately, there's not much I can do on my end (and without violating Google's TOS) to make certain things look better.

But I do agree ... hopefully Google will keep adding features to this -- it's a very neat tool. :)

Throtex 09-04-2006 06:08 PM

Quote:

Originally Posted by Bulent Tekcan
Finaly works now....

But I cannot find adjust for results.Every pages 10 result...Is this by design ?

btw, don't forget to click install!

Throtex 09-04-2006 06:23 PM

Quote:

Originally Posted by Hakaslak
Ahhh..

Well, I guess if they use the Google box, it's etter them them heading straight to Google.

My only concern is how to make sure they dont confuse the Google ebox for the real search box. >_<

Hakaslak (and others):

Searching on your site causes a vBulletin error that reads, in relevant part:
Quote:

Please specify some words or valid user names to search on. There were no matches for those that you specified.
I think you may have used a search form integration hack from this site that is faulty. If you see this message, it should inform you that for some reason the data is being passed to vBulletin rather than to Google.

The typical culprit appears to be placing the Google search form code inside of the vBulletin search form code.

Hakaslak - in your page source, I see that you have a <form> tag to open the vBulletin search, then the <form> tag to open the Google search, then a </form> tag to end the Google search, followed by a </form> tag to close the vBulletin search.

These should NOT overlap, and I suspect that anyone experiencing this error is doing the same thing. Move the </form> tag for vBulletin up to before the Google search form, or move the Google search form down outside the </form> tag for the vBulletin form. When you're clicking the "Google Search" button, it is actually sending data to the vBulletin search, rather than my php file.

Hope this helps, but I do not intend to support the search box itself. :)

voteforbird 09-04-2006 08:05 PM

Can this product perhaps be modified to have a search bar on the results page…?

Throtex 09-04-2006 08:19 PM

Quote:

Originally Posted by voteforbird
Can this product perhaps be modified to have a search bar on the results page??

Hmm, don't see why not. Right above the search results?

I envision this:
- Admin CP option to turn on/off the search bar in results page
- Admin CP text entry box to enter the necessary code (it's customized per AdSense member) for the search bar.

That might work. I'm usually pretty busy (hence my unwillingness to formally offer support) (I'm currently at work supposedly "working" right now ;) ) but I can probably get to this. Great idea, btw!

If you can't wait for me to get to it, feel free to modify the template this product installs and simply add the search box code to the top of the template. I don't see why that wouldn't work. :)

Hakaslak 09-04-2006 08:30 PM

Quote:

Originally Posted by Throtex
Hakaslak (and others):

Searching on your site causes a vBulletin error that reads, in relevant part:


I think you may have used a search form integration hack from this site that is faulty. If you see this message, it should inform you that for some reason the data is being passed to vBulletin rather than to Google.

The typical culprit appears to be placing the Google search form code inside of the vBulletin search form code.

Hakaslak - in your page source, I see that you have a <form> tag to open the vBulletin search, then the <form> tag to open the Google search, then a </form> tag to end the Google search, followed by a </form> tag to close the vBulletin search.

These should NOT overlap, and I suspect that anyone experiencing this error is doing the same thing. Move the </form> tag for vBulletin up to before the Google search form, or move the Google search form down outside the </form> tag for the vBulletin form. When you're clicking the "Google Search" button, it is actually sending data to the vBulletin search, rather than my php file.

Hope this helps, but I do not intend to support the search box itself. :)

First thing I thought was - How did he find my site. Oh yeah. My sig. Did I put a link in there? I guess I did. Then I was like... wha...? Then I thought it was working when I installed. Now I'm sad.


Thank you very much for noticing!

Hakaslak 09-04-2006 08:32 PM

OH. I get it. I thought that the form that opens up the vb search was the ajax box that comes out. Didn't really think about it much. LMAO

SaN-DeeP 09-04-2006 09:24 PM

Is it possible to make a seperate search page and use the addon code there ?

Thanks.

Throtex 09-04-2006 09:25 PM

I didn't check your sig ... I just know these things! :ninja: j/k

Glad I could help! :D

Throtex 09-04-2006 09:27 PM

Quote:

Originally Posted by SaN-DeeP
Is it possible to make a seperate search page and use the addon code there ?

Thanks.

A separate page to put the search box in, or to put the results page in?

This is a separate page for the search results -- though if you don't want it integrated you can just follow Google's instructions.

As for the search box ... you can put that anywhere you want! Best is to make a template and call it using misc.php if you want it on its own page. (i.e., this function: https://vborg.vbsupport.ru/showthread.php?t=124749 )

jcodemasters 09-04-2006 09:28 PM

I will try this mod today. thanks

SaN-DeeP 09-04-2006 09:32 PM

Quote:

Originally Posted by Throtex
A separate page to put the search box in, or to put the results page in?

This is a separate page for the search results -- though if you don't want it integrated you can just follow Google's instructions.

As for the search box ... you can put that anywhere you want! Best is to make a template and call it using misc.php if you want it on its own page. (i.e., this function: https://vborg.vbsupport.ru/showthread.php?t=124749 )

thanks I was looking to add it on a seperate page :)

bchertov 09-05-2006 05:05 AM

Quote:

Originally Posted by Throtex
Not really any point I suppose ... though the ads that show up in the search results count for your AdSense payments. Plus you get one more bite at the apple to keep people on your site ... otherwise you'd send them directly to Google as soon as they run the search.

I just think it looks nice. :) I think this is a fairly recent offering by Google, so maybe more will be possible eventually. And of course, people are free to extend this in other ways.

Well actually now that I look at your demo, the real value is interating a the Google Search box into the VB Search dialog. The fact that the results come back inside of VB is just a nice touch! :up:

In fact this will help me design my new skin! I'll install when I move to 3.6

Thanks!
Barry

djwins 09-06-2006 09:21 AM

has anyone tried with 3.5 yet?

MarkoXaser 09-06-2006 03:06 PM

Quote:

Originally Posted by Bulent Tekcan
Please specify some words or valid user names to search on. There were no matches for those that you specified.

Everytime I received this message.Any idea ?


hi, i'm an italian boy excuse me for the english..

i have the same problem.....what can i do now?


All times are GMT. The time now is 04:55 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.01314 seconds
  • Memory Usage 1,863KB
  • 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
  • (16)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