home » zplus/freepost.git
Author zPlus <--> 2016-11-29 12:46:54
Committer zPlus <--> 2016-11-29 12:46:54
Commit afba41a (patch)
Tree 4cf25e2
Parent(s)

Fix #38: freepost RSS sends two identical entries at the same time


commits diff: 508039b..afba41a
1 file changed, 21 insertions, 6 deletionsdownload


Diffstat
-rw-r--r-- rss.php 27

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+21/-6 M   rss.php
index 3abb4f6..da0a449
old size: 2K - new size: 3K
@@ -62,12 +62,27 @@ foreach ($posts as $post)
62 62 // 'r' » RFC 2822 formatted date (Example: Thu, 21 Dec 2000 16:01:07 +0200)
63 63 $date = date ('r', strtotime ($post['created']));
64 64
65 - $item->addChild ('title', htmlspecialchars ($post['title']));
66 - $item->addChild ('description', htmlspecialchars ($description));
67 - $item->addChild ('link', $link);
68 - $item->addChild ('freepostLink', $freepost_link);
69 - $item->addChild ('pubDate', $date);
70 - $item->addChild ('author', htmlspecialchars ($post['username']));
65 + /**
66 + * It's recommended that you provide the guid, and if possible make it a
67 + * permalink. This enables aggregators to not repeat items, even if there
68 + * have been editing changes.
69 + */
70 + $item->addChild ('guid', $post['hashId']);
71 +
72 + /**
73 + * Optional. If set to true, the reader may assume that it is a permalink
74 + * to the item (a url that points to the full item described by the <item>
75 + * element). The default value is true. If set to false, the guid may not
76 + * be assumed to be a url.
77 + */
78 + $item->addChild ('isPermaLink', false);
79 +
80 + $item->addChild ('title', htmlspecialchars ($post['title']));
81 + $item->addChild ('description', htmlspecialchars ($description));
82 + $item->addChild ('link', $link);
83 + $item->addChild ('freepostLink', $freepost_link);
84 + $item->addChild ('pubDate', $date);
85 + $item->addChild ('author', htmlspecialchars ($post['username']));
71 86 }
72 87
73 88 // Output RSS