Diff
Not logged in

Differences From:

File src/rss.c part of check-in [f3807dbd88] - Removed unnecessary items from WWW Configuration, also made RSS Title and Description into generic Project Name and Project Description settings, which will be used elsewhere in the web site. by jnc on 2007-10-10 02:49:29. Also file src/rss.c part of check-in [d0305b305a] - Merged mainline into my branch to get the newest application. by aku on 2007-12-05 08:07:46. [view]

To:

File src/rss.c part of check-in [90adbd8443] - /timeline.rss now accepts the same filter parameters as /timeline (e.g. y=ci for commits and y=w for wiki) by stephan on 2008-12-12 22:19:13. [view]

@@ -48,9 +48,12 @@
 void page_timeline_rss(void){
   Stmt q;
   int nLine=0;
   char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0;
-  const char zSQL[] =
+  Blob bSQL;
+  const char *zType = PD("y","all"); /* Type of events.  All if NULL */
+  blob_zero(&bSQL);
+  const char zSQL1[] =
     @ SELECT
     @   blob.rid,
     @   uuid,
     @   datetime(event.mtime),
@@ -59,10 +62,16 @@
     @   (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim),
     @   (SELECT count(*) FROM plink WHERE cid=blob.rid)
     @ FROM event, blob
     @ WHERE blob.rid=event.objid
-    @ ORDER BY event.mtime DESC
   ;
+  blob_append( &bSQL, zSQL1, -1 );
+
+  if( zType[0]!='a' ){
+      blob_appendf(&bSQL, " AND event.type=%Q", zType);
+  }
+
+  blob_append( &bSQL, " ORDER BY event.mtime DESC", -1 );
 
   cgi_set_content_type("application/rss+xml");
 
   zProjectName = db_get("project-name", 0);
@@ -84,9 +93,10 @@
   @     <link>%s(g.zBaseURL)</link>
   @     <description>%s(zProjectDescr)</description>
   @     <pubDate>%s(zPubDate)</pubDate>
   @     <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
-  db_prepare(&q, zSQL);
+  db_prepare(&q, blob_buffer(&bSQL));
+  blob_reset( &bSQL );
   while( db_step(&q)==SQLITE_ROW && nLine<=20 ){
     const char *zId = db_column_text(&q, 1);
     const char *zDate = db_column_text(&q, 2);
     const char *zCom = db_column_text(&q, 3);