Closed (fixed)
Project:
Google AdSense integration
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Jan 2007 at 01:06 UTC
Updated:
18 Feb 2008 at 05:33 UTC
Jump to comment: Most recent file
Comments
Comment #1
kbahey commentedIf you (or anyone else) can incorporate that feature as a patch, I will include it in the base functionality of the module.
Comment #2
yasI made a patch for AdSense for Search. I feel it might be necessary for the administration UI to improve in order to coexist with the existing feature.
After applied this patch, go to admin/user/access and enable 'adsense search result page' access control.
--- yas
Comment #3
yasI found myself the patch included a bug that the search results was not based on the specified domain. I fixed it so please try this one.
--- yas
Comment #4
vjuhasz commentedI installed it, but wondering how this search works, if my site's content is stored in the database. This works only for Google search, or in-site search as well?
Thanks, Val
Comment #5
yasHello vjuhasz,
The short answer is "This patch works only for Google search".
This feature presumes your site's contents are public/open/accessible to the Internet and being registered as 'index' in Google (Google's database).
So, if your site's contents are public to the Internet and every single page in your site has been already registered as index into Google, what is the advantage of AdSense for Search?
1. Extremely faster than Drupal's default in-site search
2. Integrated to your site design seamlessly if you apply this patch :)
3. May earn a little by AdSense (but IMO this is a quite minor point because the click rate of AdSense for Search might be even lower than AdSense for Content.)
If your site's contents are not public, this means, your site's contents are stored only in the database or your site's contents only can be seen after logging into your site, you can only use in-site search of Drupal's default search module.
HTH
Comment #6
Artem commentedsubscribing
Comment #7
kbahey commented@yas, thanks a lot.
I tested this and it works. I committed it to 5.x, but it needs some more work.
Can the results from Google be themed using "group" to change the colors, fonts ...etc.?
Can the same be done via "group" to the search box and button?
Comment #8
yaskbahey,
Thank you for applying my patch.
I have to report that I was warned by Google using 'adsense_for_search_1.patch' because the patch wasn't the same as the Google's original code (I omitted the radio buttons, etc).
So I _precisely_ reproduced the AdSense for Search code in this 'adsense_for_search_2.patch' except one thing --- using 'as_q' instead of 'q' as a query string parameter.
I have been running my multiple sites with this patch for almost two months, then I have never warned by Google so far.
Please test/evaluate this patch.
Thanks in advance.
Comment #9
yaskbahey,
> Can the results from Google be themed using "group" to change the colors, fonts ...etc.?
Yes.
> Can the same be done via "group" to the search box and button?
No, however, you can customize your search box and button with your css like this:
#####
.adsense_search tbody {...}
.adsense_search table {...}
.adsense_search td {...}
input #sbi {...} /* search box */
input #sbb {...} /* search button */
##### example:
.adsense_search tbody {border-top: none; text-align: center; padding: 0 0 0 0;}
.adsense_search table {background: none; border: none; margin: 0; width: 200px; clear: right; padding: 0 0 0 0;}
.adsense_search td {border: none; padding: 0 0 0 0;}
.adsense_search td:hover {background: none;}
input #sbb {padding: 0 35px 0 35px;}
#googleSearchUnitIframe {text-align: center;} /* alignment of the search result from Google */
#####
Comment #10
kbahey commentedPlease download the -dev version, and create a patch against it, and I will test and apply it.
Comment #11
yaskbahey,
I remade the patch for ver. 1.50.2.24.
I hope this one will meet your expectation.
Comment #12
kbahey commentedNo
There are still too many changes in this patch without need.
Start with the latest -dev, and make the change ONLY for the things that Google objected to.
Do not move code around and make the patch too big to review.
Comment #13
kbahey commentedHi.
Can you please roll the patch that corrects Google's code against the version in the repository, so it has less lines to review?
Also, it would be nice to log the search terms in watchdog, just like Drupal's search module did.
Let me know if you will do this soon, or we should wait for a while.
Comment #14
yaskbahey,
Sorry for my late response because last week I was busy for studying in order to prepare a difficult interview of a certain company.
I wish I would make it this time around --- less lines to review.
Logging the search terms in watchdog is included.
Comment #15
kbahey commentedI hope the interview went well.
I applied the patch to the repository, with a lot of changes for code style.
It makes some sites look really ugly though, check Egyptian Cuisine Recipes. but that is Google's fault, not the module. I will ask Google if the buttons can be styled or something. They have said no in the past.
One more thing: Google allows the background to be configurable with an HTML code. We already have "groups" for color. So can you change the settings instead of selecting a background color as black, white, gray, it can be a group, and the group's background color will be chosen.
First, please delete your copy of adsense.module and refresh from the CVS repository before you modify the code and create a patch.
Comment #16
kbahey commentedAnd the code can be made to be XHTML compliant as well, simply by removing 2 closing tags.
Details on Google's Adsense help.
Comment #17
kbahey commentedyas.
To be clear: I already did the change in #16 so the code is XHTML compliant. You do not need to do it. Just work on #15 when you can. I asked Google about changing the search code to allow styling, and waiting for the reply.
Comment #18
yaskbahey,
Thank you for applying my code.
1. Background
Have you already tried to modify your css with .adsense_search table as #9 that I posted?
My code is supposed to output <div class="adsense adsense_search"> ... </div> tag, so I think you can solve this issue without any alterations of your adsense for search code by specifying no table's background in your css like this:
.adsense_search table {
background: none;
}
Just add one line above into your css.
2. Button
Also you can make change button appearance with your css like this:
.adsense_search input {
background-color: #FFF;
color: #999999;
font-size: 12px;
padding: 2px;
margin: 2px 0px 2px 0px;
border: 1px solid #CCC;
}
Please try 1. and 2. above in your css.
Any modification of adsense for search code will result in Google's warning as I have already been done, so don't do that.
The example sites are:
http://perltips.twinkle.cc/
http://bayarean.twinkle.cc/ (I am applying a GIF image to the button, it is working well in Firefox, but IE is not)
http://recipe.2kids.net/
HTH
Comment #19
kbahey commentedThanks for the hint.
What I ended up doing is this:
Good thing Google has CSS ids for these elements.
What I cannot do is reduce the width of URL listed in the radio button ...
Marking this as fixed.
Thanks again.
Comment #20
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.