1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 05:02:02 +02:00

Google Sitemap: The XML sitemap can now be retrieved from /sitemap.xml

This commit is contained in:
Cameron 2020-05-12 16:41:41 -07:00
parent b25dfa99af
commit d7889bc759
3 changed files with 10 additions and 5 deletions

View File

@ -48,4 +48,3 @@ function pingit($vals)
}
?>

View File

@ -34,6 +34,14 @@ class gsitemap_url // plugin-folder + '_url'
);
$config['xml'] = array(
'alias' => 'sitemap',
'regex' => '^sitemap\.xml$', // matched against url, and if true, redirected to 'redirect' below.
'sef' => 'sitemap.xml', // used by e107::url(); to create a url from the db table.
'redirect' => '{e_BASE}gsitemap.php', // file-path of what to load when the regex returns true.
);
return $config;

View File

@ -59,9 +59,7 @@ if(e_QUERY == "show" || !empty($_GET['show']))
header('Content-type: application/xml', TRUE);
$xml = "<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns='http://www.google.com/schemas/sitemap/0.84'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd'>";
<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>";
$smArray = $sql ->retrieve("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ORDER BY gsitemap_order ",true);
@ -94,4 +92,4 @@ function get_iso_8601_date($int_date)
}
?>