<?php
header('Content-Type: application/xml; charset=utf-8');
require 'config.php';
$base = 'https://kinder-des-glaubens.de';
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url><loc><?= $base ?>/</loc><priority>1.0</priority><changefreq>daily</changefreq></url>
  <url><loc><?= $base ?>/shop.php</loc><priority>0.8</priority><changefreq>weekly</changefreq></url>
  <url><loc><?= $base ?>/page.php?p=impressum</loc><priority>0.3</priority></url>
  <url><loc><?= $base ?>/page.php?p=datenschutz</loc><priority>0.3</priority></url>
  <url><loc><?= $base ?>/page.php?p=agb</loc><priority>0.3</priority></url>
<?php
try{
 $items = db()->query("SELECT id FROM shop_items")->fetchAll();
 foreach($items as $it){ echo "<url><loc>$base/shop.php#item-{$it['id']}</loc><priority>0.6</priority></url>\n"; }
}catch(Exception $e){}
?>
</urlset>
