<?php
-ob_clean();
+if (!$User) return;
header('Content-Type: application/atom+xml; charset=utf-8');
print '<?xml version="1.0" encoding="utf-8"?>';
$siteref = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST'];
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php
+$caller = $Page;
$search = new PageSearch();
foreach ($search->files() as $link) {
$article = new ArchiveArticle($link);
print '<url>';
print "<loc>$siteref/{$article->link}</loc>";
+ $score = 10;
+ if ($article->link) {
+ $score -= substr_count($article->link, '/') + 1; # -10% per subdir
+ $age = time() - strtotime($article->dateiso);
+ $age /= 3600 * 24 * 365; # years
+ if ($age > .1) $score -= $age / 10 + .1; # -1% per year
+ }
+ printf('<priority>%.2f</priority>', $score / 10);
if ($article->last) {
print "<lastmod>{$article->lastiso}</lastmod>";
}
print "</url>\n";
}
+$Page = $caller;
?>
</urlset>
<?php