Overview
SHA1 Hash: | 90adbd84430549a9877ef3ec20171c42ac37afa5 |
---|---|
Date: | 2008-12-12 22:19:13 |
User: | stephan |
Comment: | /timeline.rss now accepts the same filter parameters as /timeline (e.g. y=ci for commits and y=w for wiki) |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/rss.c from [05e7ced61b] to [07391be604].
@@ -47,11 +47,14 @@ 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), @ coalesce(ecomment,comment), @@ -58,12 +61,18 @@ @ coalesce(euser,user), @ (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); if( zProjectName==0 ){ @@ -83,11 +92,12 @@ @ <title>%s(zProjectName)</title> @ <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); const char *zAuthor = db_column_text(&q, 4);