From a65419d5361a0b3623905a484a811741c6cffadd Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Sat, 29 Apr 2006 11:16:03 +0000 Subject: [PATCH] alter title for comment feeds --- include/functions_comments.inc.php | 2 +- rss.php | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/include/functions_comments.inc.php b/include/functions_comments.inc.php index 1037f5e..ef371f8 100644 --- a/include/functions_comments.inc.php +++ b/include/functions_comments.inc.php @@ -144,7 +144,7 @@ function serendipity_fetchComments($id, $limit = null, $order = '', $showAll = f $query = "SELECT $distinct co.id, - co.entry_id, co.timestamp, co.title, co.email, co.url, co.ip, co.body, co.type, co.subscribed, + co.entry_id, co.timestamp, co.title AS ctitle, co.email, co.url, co.ip, co.body, co.type, co.subscribed, co.author, e.title, e.id AS entryid, diff --git a/rss.php b/rss.php index 0b28c59..b6b87d1 100644 --- a/rss.php +++ b/rss.php @@ -28,17 +28,17 @@ if (!isset($_GET['type'])) { $_GET['type'] = 'content'; } -if (!isset($_GET['nocache'])) { - switch ($_GET['type']) { - case 'comments': - $latest_entry = serendipity_fetchComments(isset($_GET['cid']) ? $_GET['cid'] : null, 1, 'desc'); - break; - case 'content': - default: - $latest_entry = serendipity_fetchEntries(null, false, 1, false, false, 'last_modified DESC', '', false, true); +switch ($_GET['type']) { + case 'comments': + $latest_entry = serendipity_fetchComments(isset($_GET['cid']) ? $_GET['cid'] : null, 1, 'desc'); break; - } + case 'content': + default: + $latest_entry = serendipity_fetchEntries(null, false, 1, false, false, 'last_modified DESC', '', false, true); + break; +} +if (!isset($_GET['nocache'])) { /* * Caching logic - Do not send feed if nothing has changed * Implementation inspired by Simon Willison [http://simon.incutio.com/archive/2003/04/23/conditionalGet], Thiemo Maettig @@ -78,8 +78,12 @@ if (isset($modified_since) && switch ($_GET['type']) { case 'comments': $entries = serendipity_fetchComments(isset($_GET['cid']) ? $_GET['cid'] : null, $serendipity['RSSfetchLimit'], 'desc'); - $title = $title . ' ' . COMMENTS; - $description = COMMENTS_FROM . ' ' . $description; + $description = $title . ' - ' . $description; + if (isset($_GET['cid'])) { + $title = $title . ' - ' . COMMENTS_FROM . ' "' . $latest_entry[0]['title'] . '"'; + } else { + $title = $title . ' - ' . COMMENTS; + } $comments = TRUE; break; case 'content': -- 2.39.5