<?php

header('Content-Type: text/xml');

// this page is not a real page, but returns an xml with
// all visible pages from the `pages` database.

$templ_page_valid = TRUE;

include_once('util/incl.php');

//db_connect();

?><? echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">
<?php
    $obj = api_pages_list($DBCONN);
    foreach ($obj['results'] as $id => $row)
    {
        $mtime = date('Y-m-d', get_last_edit($row['location']);
?>
  <url>
    <loc><?php echo htmlspecialchars("https://www.sunfiregold.com/$row[location].php"); ?></loc>
    <lastmod><?php echo $mtime; ?></lastmod>
    <changefreq><?php echo htmlspecialchars($row['search_chfreq']); ?></changefreq>
    <priority><?php echo htmlspecialchars($row['search_priority']); ?></priority>
  </url>
<?php
    }
?>
</urlset>