xml-sitemap-5.X is not working in mozilla or IE
amarbijay - December 2, 2008 - 10:24
Hi,
I am using drupal v 5.12 and I installed xml-sitemap v5.x. It is not working in any browser.
url is like http://localhost/drupal5/sitemap.xml
This showing an error in IE and mozilla.
Please anyone help me to solve this issue, I am waiting...........
Regards
AB

Update this function in
Update this function in "xmlsitemap.module" file.....it will work definitely.
function _xmlsitemap_output($chunk = NULL) {
drupal_set_header('Content-type: text/xml; charset=utf-8');
global $user;
$dest = file_directory_path() .'/xmlsitemap';
file_check_directory($dest, TRUE);
if (isset($chunk)) {
$dest .= "/sitemap$chunk.xml.gz";
$type = t('Site map @chunk', array('@chunk' => $chunk));
}
else {
$dest .= '/sitemap.xml.gz';
$link_count = _xmlsitemap_link_count();
$chunk_size = variable_get('xmlsitemap_chunk_size', 50000);
$type = $link_count > $chunk_size ? t('Site map index') : t('Site map');
}
$status = TRUE;
if (!file_exists($dest) || variable_get('xmlsitemap_update', FALSE)) {
$page = isset($chunk) ? $chunk : 'index';
$status = _xmlsitemap_update_cache($page);
}
if ($status) {
if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') === FALSE || zlib_get_coding_type() !== FALSE || extension_loaded('eAccelerator') || (variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED && empty($user->uid))) {
//readgzfile($dest);
/*+++++++++++++ ADDED BY PENNYWISE.ORG ON 02-12-2008 +++++++++++++++++++*/
$zd = gzopen($dest, "r");
$fp = fopen("sitemap.xml", "w+");
@chmod("sitemap.xml", 0777);
$contents = gzread($zd, 50000);
fwrite($fp, $contents);
fclose($fp);
gzclose($zd);
$cont = file_get_contents("sitemap.xml");
echo $cont;
/*+++++++++++++ END +++++++++++++++++++++++++++++++++*/
}
else {
drupal_set_header('Content-Encoding: gzip');
print file_get_contents($dest);
}
if (variable_get('xmlsitemap_log_access', FALSE)) {
$message = array_shift(module_invoke_all('xmlsitemap_engines', 'access', $type));
$message = isset($message) ? $message : t('!sitemap downloaded by @user-agent at @address.', array(
'!sitemap' => $type,
'@user-agent' => $_SERVER['HTTP_USER_AGENT'],
'@address' => $_SERVER['REMOTE_ADDR'],
));
watchdog('xmlsitemap', $message);
}
}
else {
drupal_not_found();
}
}