3 files changed, 15 insertions(+), 11 deletions(-)

M changelog.php
M feed.php
M includes/site_header.php
M changelog.php +2 -0
@@ 11,6 11,8 @@ require 'includes/app.php';
 <main>
     <h1>Changelog</h1>
 
+    <p><a href="feed.php?u=<?=$site_user['name']?>">Subscribe via RSS</a></p>
+
     <ul>
         <?php foreach ($pages as $page): ?>
             <li><time><?=to_date($page['updated_at'])?></time> <?=site_link($page['name'], $page['slug'])?></li>

          
M feed.php +12 -10
@@ 1,21 1,23 @@ 
 <?php
 require 'includes/app.php';
 
+$u = get_param("u");
+$site_user = $App->getUser()->getFromUsername($u) or page_not_found();
+
 header('Content-Type: application/xml');
-$res = $App->getImage()->getAll(1);
-$images = $res['rows'];
+$pages = $App->getPage()->getChangelog($u);
 ?>
 <rss version="2.0">
     <channel>
-        <title>piclog</title>
-        <description>A little place to upload and share your pictures.</description>
-        <link><?= URL ?></link>
-        <?php foreach ($images as $image): ?>
+        <title><?= $site_user['name'] ?></title>
+        <description><?= $site_user['name'] ?>'s wiki</description>
+        <link><?= site_url($site_user['name']) ?></link>
+        <?php foreach ($pages as $page): ?>
             <item>
-                <title><?= $image['name'] ?> uploaded <?= $image['filename'] ?></title>
-                <pubDate><?= date(DATE_RSS, strtotime($image['published_at'])) ?></pubDate>
-                <guid><?= URL . '/image.php?id=' . $image['id'] ?></guid>
-                <link><?= URL . '/image.php?id=' . $image['id'] ?></link>
+                <title><?= $page['slug'] ?></title>
+                <pubDate><?= date(DATE_RSS, strtotime($page['updated_at'])) ?></pubDate>
+                <guid><?= htmlspecialchars(site_url($site_user['name'], $page['slug'])) ?></guid>
+                <link><?= htmlspecialchars(site_url($site_user['name'], $page['slug'])) ?></link>
             </item>
         <?php endforeach; ?>
     </channel>

          
M includes/site_header.php +1 -1
@@ 5,7 5,7 @@ 
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <title><?=$p??'home'?> - <?=$site_user['name']?></title>
     <link rel="stylesheet" href="style.css">
-    <link type="application/atom+xml" rel="alternate" href="feed.php">
+    <link type="application/xml" rel="alternate" href="feed.php?u=<?=$site_user['name']?>">
     <style>
         <?=$site_user['style']?>
     </style>