From afba41a19a5f14d96c934a578da62f07b08f4b47 Mon Sep 17 00:00:00 2001 From: zPlus <--> Date: Tue, 29 Nov 2016 13:46:54 +0100 Subject: [PATCH] Fix #38: freepost RSS sends two identical entries at the same time --- rss.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/rss.php b/rss.php index 3abb4f6c..da0a4496 100644 --- a/rss.php +++ b/rss.php @@ -62,12 +62,27 @@ foreach ($posts as $post) // 'r' ยป RFC 2822 formatted date (Example: Thu, 21 Dec 2000 16:01:07 +0200) $date = date ('r', strtotime ($post['created'])); - $item->addChild ('title', htmlspecialchars ($post['title'])); - $item->addChild ('description', htmlspecialchars ($description)); - $item->addChild ('link', $link); - $item->addChild ('freepostLink', $freepost_link); - $item->addChild ('pubDate', $date); - $item->addChild ('author', htmlspecialchars ($post['username'])); + /** + * It's recommended that you provide the guid, and if possible make it a + * permalink. This enables aggregators to not repeat items, even if there + * have been editing changes. + */ + $item->addChild ('guid', $post['hashId']); + + /** + * Optional. If set to true, the reader may assume that it is a permalink + * to the item (a url that points to the full item described by the + * element). The default value is true. If set to false, the guid may not + * be assumed to be a url. + */ + $item->addChild ('isPermaLink', false); + + $item->addChild ('title', htmlspecialchars ($post['title'])); + $item->addChild ('description', htmlspecialchars ($description)); + $item->addChild ('link', $link); + $item->addChild ('freepostLink', $freepost_link); + $item->addChild ('pubDate', $date); + $item->addChild ('author', htmlspecialchars ($post['username'])); } // Output RSS