
07-15-2009, 11:12 AM
|
|
|
Join Date: Dec 2003
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by T2x
As far as making google happy, ( This code will ONLY work if you have VBSEO)
Do this:
1. Open up your translate.php.
find these lines:
Code:
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
change it to:
Code:
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@curl_setopt($ch, CURLOPT_REFERER,"http://$_SERVER[SERVER_NAME]$_SERVER[VBSEO_URI]");
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
2. Also in translate.php
Go to http://code.google.com/apis/ajaxsearch/signup.html
Get an api key for your site, copy it
find:
Code:
@curl_setopt($ch, CURLOPT_URL, "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&langpair=".urlencode($fl.'|'.$tl)."&q=".urlencode($text));
change it to
Code:
@curl_setopt($ch, CURLOPT_URL, "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&key=COPYYOURKEYHERE&langpair=".urlencode($fl.'|'.$tl)."&q=".urlencode($text));
Of course replace "COPYYOURKEYHERE" with the key you got from google.
That's all.
Easy as pie.
This will ensure google knows where the requests are coming from and that they can contact you in case of problems instead of just banning you from all of google by ip.
|
Thanks! I added this and it is working. Seems like a good idea to follow Google's requirements and use this API key.
|