if (!empty($dir[$i][0])) { $s .= $SitemapGenerator->update_dir_info($relpa, $dir[$i][0], $vars2_site_root, "html", $sitemap_changefreq, $sitemap_priority); } } $SitemapGenerator->write_file($relpa . $sitemap_xml, '<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="' . htmlentities($vars2_site_root) . 'feeds/sitemap.xsl"?> <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>' . htmlentities($vars2_site_root) . '</loc> <lastmod>' . date('Y-m-d\\TH:i:s+00:00') . '</lastmod> <changefreq>daily</changefreq> <priority>' . $sitemap_priority . '</priority> </url> ' . $s . ' </urlset>', "w+"); /** * update sitemap.xml.gz */ $SitemapGenerator->compressToGZ($relpa . $sitemap_xml, $relpa . $sitemap_xml_gz); /** * update urllist.txt */ $urllist_txt = 'urllist.txt'; $s = ''; for ($i = 0; $i < count($dir); $i++) { if (!empty($dir[$i][0])) { $s .= $SitemapGenerator->update_dir_info2($relpa, $dir[$i][0], $vars2_site_root, "html"); } } $SitemapGenerator->write_file($relpa . $urllist_txt, $s, "w+"); echo 'done!';