You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
592 B

7 years ago
  1. <?php
  2. ob_start();
  3. echo "<?xml version=\"1.0\" encoding=\"" . config_item('charset') . "\"?".">\n";
  4. echo "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
  5. if ( count($list) > 0 ) {
  6. foreach ($list as $row) {
  7. echo "<url>".PHP_EOL;
  8. echo "<loc>{$row['loc']}</loc>".PHP_EOL;
  9. echo "<lastmod>{$row['lastmod']}</lastmod>".PHP_EOL;
  10. echo "<priority>{$row['priority']}</priority>".PHP_EOL;
  11. echo "<changefreq>{$row['changefreq']}</changefreq>".PHP_EOL;
  12. echo "</url>\n";
  13. }
  14. }
  15. echo "</urlset>\n";
  16. $xml = ob_get_clean();
  17. echo $xml;