load($path . $siteMapFile); $root = $xml->documentElement; $siteMap = $root->getElementsByTagName('sitemap'); foreach ($siteMap as $item) { $loc = $item->getElementsByTagName('loc'); if (strpos($loc->item(0)->nodeValue, $path) !== false) { if ($prefs['feature_sefurl'] === 'y') { $loc->item(0)->nodeValue = str_replace($path, '', $loc->item(0)->nodeValue); } else { $loc->item(0)->nodeValue = str_replace($path, 'tiki-sitemap.php?file=', $loc->item(0)->nodeValue); } } } echo $xml->saveXML(); } else { $file = file_get_contents($path . $_REQUEST['file']); echo $file; } } else { $smarty->assign( 'msg', tra( 'Required features: sitemap_enable. If you do not have permission to activate these features, ask the site administrator.' ) ); $smarty->display('error.tpl'); }