Add news item content as <description> field in RSS feed. Fixes viewers that
authorRyan C. Gordon <icculus@icculus.org>
Thu, 12 Apr 2007 11:52:05 +0000
changeset 75 db7b208f1ef6
parent 74 a0237411d454
child 76 b25d8dba5315
Add news item content as <description> field in RSS feed. Fixes viewers that
want to show more than just the link and title, like Sage.
IcculusNews_daemon.pl
--- a/IcculusNews_daemon.pl	Thu Jan 25 19:37:12 2007 +0000
+++ b/IcculusNews_daemon.pl	Thu Apr 12 11:52:05 2007 +0000
@@ -491,7 +491,7 @@
     $max = $row[8] if not defined $max;
 
     $sql = "select t1.author, t1.id, t1.title, t1.postdate, t2.name," .
-           " t1.ip, t1.approved, t1.deleted" .
+           " t1.ip, t1.approved, t1.deleted, t1.text" .
            " from $dbtable_items as t1" .
            " left outer join $dbtable_users as t2" .
            " on t1.author=t2.id" .
@@ -525,6 +525,7 @@
         my $ipaddr       = long2ip($row[5]);
         my $approved     = $row[6];
         my $deleted      = $row[7];
+        my $text         = encode_entities($row[8]);
         my $viewurl = $itemviewurl;
         1 while ($viewurl =~ s/\%id/$itemid/);
         $viewurl = encode_entities($viewurl);
@@ -542,6 +543,7 @@
         $rdfitems .= "    <ipaddr>$ipaddr</ipaddr>\n";
         $rdfitems .= "    <approved>$approved</approved>\n";
         $rdfitems .= "    <deleted>$deleted</deleted>\n";
+        $rdfitems .= "    <description>\n$text\n    </description>\n";
         $rdfitems .= "  </item>";
     }
     $sth->finish();