]> git.mjollnir.org Git - s9y.git/commitdiff
alter title for comment feeds
authorgarvinhicking <garvinhicking>
Sat, 29 Apr 2006 11:16:03 +0000 (11:16 +0000)
committergarvinhicking <garvinhicking>
Sat, 29 Apr 2006 11:16:03 +0000 (11:16 +0000)
include/functions_comments.inc.php
rss.php

index 1037f5e67039fe139b2e8bee93716b145a449ebf..ef371f8139520caf2abb5771db6c6453cc086081 100644 (file)
@@ -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 0b28c59cfa9b15c77b9f326f0563e53985535ce4..b6b87d1af18cead2448afde275664f40137614f8 100644 (file)
--- 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':