- echo "<" . "?xml version='1.0' encoding='UTF-8'?" . ">\n\n";
- echo "\t<urlset" . ' xmlns="http://www.google.com/schemas/sitemap/0.84"' . "\n";
- echo "\t" . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . "\n";
- echo "\t" . 'xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84' . "\n";
- echo "\t" . ' http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">' . "\n";
-
- while (list(,$url) = each($sitemap)) {
- echo "\t<url>\n";
-
- while (list($key,$value) = each($url)) {
+
+ if (end($path_arr) == 'ror.xml') {
+
+ // ror sitemap feed
+ $sitemapHeader ="<" . "?xml version='1.0' encoding='UTF-8'?" . ">\n\n"
+ . "<!-- This file is a ROR Sitemap for describing this website to the search engines. "
+ . "For details about the ROR format, go to www.rorweb.com. -->\n"
+ . '<rss version="2.0" xmlns:ror="http://rorweb.com/0.1/" >' . "\n"
+ . "<channel>\n";
+
+ } else {
+
+ // old Google sitemap protocol ver.0.84
+// $sitemapHeader = "<" . "?xml version='1.0' encoding='UTF-8'?" . ">\n\n";
+// . "\t<urlset" . ' xmlns="http://www.google.com/schemas/sitemap/0.84"' . "\n";
+// . "\t" . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . "\n";
+// . "\t" . 'xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84' . "\n";
+// . "\t" . ' http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">' . "\n";
+
+ // new sitemap common protocol ver 0.9
+ $sitemapHeader = "<" . "?xml version='1.0' encoding='UTF-8'?" . ">\n\n"
+ . '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . "\n"
+ . ' xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9' . "\n"
+ . ' http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"' . "\n"
+ . ' xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"';
+ // uncomment and edit next line when you need "example_schema"
+// $sitemapHeader .= ' xmlns:example="http://www.example.com/schemas/example_schema"';
+ $sitemapHeader .= '>';
+
+ }
+
+ echo $sitemapHeader;
+ if (end($path_arr) == 'ror.xml') {
+ echo $sitemapTitle;
+ }
+
+ while (list(, $url) = each($sitemap)) {
+
+ if (end($path_arr) == 'ror.xml') {
+ echo "\t<item>\n";
+ } else {
+ echo "\t<url>\n";
+ }
+
+ while (list($key, $value) = each($url)) {