From: garvinhicking Date: Sat, 29 Apr 2006 11:16:03 +0000 (+0000) Subject: alter title for comment feeds X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a65419d5361a0b3623905a484a811741c6cffadd;p=s9y.git alter title for comment feeds --- 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':