PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
AdSense Search - Selected Sites and Similar Pages (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: AdSense Search - Selected Sites and Similar Pages
#482
grrlfriend (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
AdSense Search - Selected Sites and Similar Pages 5 Months, 1 Week ago Karma: 0  
First off, I was so glad to find the googleSearch component. It has saved me a lot of time and I love how it opens in the body of my site.

My questions are:
1. How can I get it to search multiple sites? The code generated when setting up AdSense for Search allows this but I haven't figured out how to add the second one to the googleSearch componenet.
2. How can I get rid of the "Similar pages" link (which doesn't work on my site)?

Thanks in advance!
 
  The administrator has disabled public write access.
#484
kksou (Admin)
Admin
Posts: 451
graph
User Online Now Click here to see the profile of this user
Re:AdSense Search - Selected Sites and Similar Pages 5 Months, 1 Week ago Karma: 9  
Hi,

1. To search multiple sites, you need to use Google's new Google Custom Search. The problem with this is that everything is stored on Google's server when you set up the thing. This means that there's no way you can allow user to tweak the foreground, background color, etc. on-the-fly like what we're doing in the options page of the googleSearch component. Of course, using the "older" method like what I've done in the googleSearch component also means that it cannot do multiple sites search. If you really need that, then go with the the Google Custom Search.

2. The search results are dictated by google. Don't think there's any way to control that.

Regards,
/kksou
 
  The administrator has disabled public write access.
#496
grrlfriend (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:AdSense Search - Selected Sites and Similar Pages 5 Months, 1 Week ago Karma: 0  
kksou,
Thanks for the incredibly fast reply. I was hoping that it would be possible to combine the best of both the Google Custom Search and the googleSearch component but I'll have to work around it somehow.

Thanks again!
 
  The administrator has disabled public write access.
#502
grrlfriend (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:AdSense Search - Selected Sites and Similar Pages 5 Months, 1 Week ago Karma: 0  
Quick follow-up: figured out how to get rid of the "Similar pages" link (which didn't work for me). To mash the Custom Google Search with the googleSearch component, in the googleSearch.lib.php file, change the line (#91 for me)
from:
$this->hiddenfield('client','pub-'.$google_id);

to:
$this->hiddenfield('cx','partner-pub-'.$google_id.':3s9tocw8zah');

where the ':3s9tocw8zah' is whatever your Custom Google Search code says. If I had more time, I'd figure out how to incorporate it into the component code. The key was changing from "client" to "cx"
 
  The administrator has disabled public write access.
#505
kksou (Admin)
Admin
Posts: 451
graph
User Online Now Click here to see the profile of this user
Re:AdSense Search - Selected Sites and Similar Pages 5 Months, 1 Week ago Karma: 9  
Hi,

Thanks for sharing this. Looks very interesting.

Do let me know if you find out anything more. I'm sure your research result will benefit a lot of people.

I'll also try your suggestion this weekend. If it works, I will incorporate this into the next release.

Thanks and Regards,
/kksou
 
  The administrator has disabled public write access.
#509
grrlfriend (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:AdSense Search - Selected Sites and Similar Pag 5 Months, 1 Week ago Karma: 0  
Okay, finally got it to work the way I want it to.

I changed code in admin.googlesearch.php to allow for the full google id. Line 43 was changed to:
if (trim($_POST['google_id'])!='' && !preg_match('/^\d{16}:\w/', $_POST['google_id'])) {

This allows for the 16 digits followed by a colon followed by the alpha-numeric string. This of course required the database field size to be changed to 28 from 16. There were a couple of other spots in files that were also changed from 16 to 28 but I'd have to hunt those down again.

To get multiple sites to be searched, I set up the sites in the Google Adsense Custom code on the Google website (thus the need for the full partner-pub #). In googlesearch.lib.php, commented out lines 175-182 (before "else" but after "{" and after the "}").

I think that was pretty much all - rough but it works :) Not sure how it functions with two Joomla sites - one of mine is Joomla, the other isn't - so there may be other changes required for that situation.

kksou, I can bundle the files and send them to you if you would like for reference.

edit: To view it in action, check it out at http://www.thisweeklive.com/index.php?option=com_googlesearch&Itemid=1819

My general manager is EXTREMELY happy with the result.
 
 
Last Edit: 2008/08/01 07:36 By grrlfriend.
  The administrator has disabled public write access.
#510
grrlfriend (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:AdSense Search - Selected Sites and Similar Pages 5 Months, 1 Week ago Karma: 0  
Forgot to mention, this doesn't allow for radio buttons to choose individual sites or web search but I'm sure I'll be looking into that in the future...too tired now :)
 
  The administrator has disabled public write access.
#1403
kksou (Admin)
Admin
Posts: 451
graph
User Online Now Click here to see the profile of this user
Re:AdSense Search - Selected Sites and Similar Pages 1 Day, 4 Hours ago Karma: 9  
grrlfriend wrote:
How can I get it to search multiple sites? The code generated when setting up AdSense for Search allows this but I haven't figured out how to add the second one to the googleSearch componenet.


Hi,

If you need to search multiple sites, please use the new googleSearch component that I've just written that make use of Google's new Custom Search Engine (CSE):

googleSearch (CSE) component

googleSearch (CSE) module

Regards,
/kksou
 
 
Last Edit: 2009/01/06 14:33 By kksou.
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2009. kksou.com. All Rights Reserved