2015-03-11, 17:54:29
Hello,
today I updated to 3.3.5 and suddenly the old sitemap problem occured again.
The standard template_functions.php in the 3.3.5 package has a Google URL which is not working any more. This one works:
Bye
Hypertexter
today I updated to 3.3.5 and suddenly the old sitemap problem occured again.
The standard template_functions.php in the 3.3.5 package has a Google URL which is not working any more. This one works:
Code:
/**
* Ping Sitemaps
*
* @since 1.0
*
* @param string $url_xml XML sitemap
* @return bool
*/
function pingGoogleSitemaps($url_xml) {
$status = 0;
$google = 'www.google.com';
$bing = 'www.bing.com';
$ask = 'submissions.ask.com';
if( $fp=@fsockopen($google, 80) ) {
$req = 'GET /webmasters/tools/ping?sitemap=' . /* old: 'GET /webmasters/sitemaps/ping?sitemap=' . */
urlencode( $url_xml ) . " HTTP/1.1\r\n" .
"Host: $google\r\n" .
"User-Agent: Mozilla/5.0 (compatible; " .
PHP_OS . ") PHP/" . PHP_VERSION . "\r\n" .
"Connection: Close\r\n\r\n";
fwrite( $fp, $req );
while( !feof($fp) ) {
if( @preg_match('~^HTTP/\d\.\d (\d+)~i', fgets($fp, 128), $m) ) {
$status = intval( $m[1] );
break;
}
}
fclose( $fp );
}
Bye
Hypertexter