Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv5186
Modified Files:
NEWS rss.php serendipity_functions.inc.php
Log Message:
Fix slash:comments for RSS-feed
Implemented wfw:commentRSS to show per-entry comment-feed. Is interpreted by SharpReader
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- NEWS 11 Nov 2003 16:17:03 -0000 1.36
+++ NEWS 14 Nov 2003 12:27:25 -0000 1.37
@@ -2,6 +2,7 @@
Version 0.4 ()
------------------------------------
+ * RSS2.0-feed now contains wfw:comments link for per-entry comments. Is interpreted by SharpReader i.e.
* XHTML1 compatibility fixes, missing <tr> from the calendar fixed. Thanks to casper/jedijab79 from the forums (garvinhicking)
* Reworked Syndication plugin to allow future embedding of new RSS-fields depending with individual content.
First example is the pubDate-field for the 'channel'-context, as suggested by Justin Alcorn (garvinhicking)
Index: rss.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/rss.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- rss.php 11 Nov 2003 15:38:45 -0000 1.15
+++ rss.php 14 Nov 2003 12:27:25 -0000 1.16
@@ -20,7 +20,7 @@
switch ($_GET['type']) {
case 'comments':
- $entries = serendipity_fetchComments(null, 15, 'desc');
+ $entries = serendipity_fetchComments(isset($_GET['cid']) ? $_GET['cid'] : null, 15, 'desc');
$title = $title . ' ' . COMMENTS;
$description = COMMENTS_FROM . ' ' . $description;
$comments = TRUE;
@@ -75,7 +75,8 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:admin="http://webns.net/mvcb/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:slash="http://purk.org/rss/1.0/modules/slash/"
+ xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:robot="http://www.edwardbear.org/def/xml/robot">
<channel>
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- serendipity_functions.inc.php 11 Nov 2003 16:17:05 -0000 1.167
+++ serendipity_functions.inc.php 14 Nov 2003 12:27:25 -0000 1.168
@@ -1185,7 +1185,14 @@
?>
<category><?php echo utf8_encode(htmlspecialchars($entry['category_name'])); ?></category>
<comments><?php echo $guid; ?></comments>
+<?php
+ if ($comments === false) {
+?>
<slash:comments><?php echo $entry['comments']; ?></slash:comments>
+ <wfw:commentRss><?php echo $serendipity['baseURL']; ?>rss.php?version=<?php echo $version; ?>&type=comments&cid=<?php echo (isset($entry['entryid']) && $entry['entryid'] != '' ? $entry['entryid'] : $entry['id']); ?></wfw:commentRss>
+<?php
+ }
+?>
<author><?php echo utf8_encode(htmlspecialchars($entry['email'])) . ' (' . utf8_encode(htmlspecialchars($entry['username'])) . ')'; ?></author>
<content:encoded>
<?php echo utf8_encode(htmlspecialchars(nl2br(serendipity_emoticate(serendipity_markup_text($entry['body'] . $ext))))); ?>
|