Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Allow filtering by filename, tag or wiki page as well as by ticket UUID. Better handling of invalid values (they now generate empty RSS feeds rather than appending the HTML footer...). |
|---|---|
| Timelines: | family | ancestors | descendants | both | dg-misc |
| Files: | files | file ages | folders |
| SHA1: |
d244452bda788c3f940a0a8b616827bd |
| User & Date: | dg 2013-02-06 17:37:49.416 |
Context
|
2013-02-12
| ||
| 16:47 | Merge from trunk. check-in: e4a698bdd2 user: dg tags: dg-misc | |
|
2013-02-06
| ||
| 17:37 | Allow filtering by filename, tag or wiki page as well as by ticket UUID. Better handling of invalid values (they now generate empty RSS feeds rather than appending the HTML footer...). check-in: d244452bda user: dg tags: dg-misc | |
|
2013-02-05
| ||
| 23:40 | Merge from trunk. check-in: 21da639fee user: dg tags: dg-misc | |
Changes
Changes to src/rss.c.
| ︙ | ︙ | |||
20 21 22 23 24 25 26 | #include "config.h" #include <time.h> #include "rss.h" #include <assert.h> /* ** WEBPAGE: timeline.rss | | | > > > > | > > > > | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
#include "config.h"
#include <time.h>
#include "rss.h"
#include <assert.h>
/*
** WEBPAGE: timeline.rss
** URL: /timeline.rss/y=TYPE&n=LIMIT&tkt=UUID&tag=TAG&wiki=NAME&name=FILENAME
**
** Produce an RSS feed of the timeline.
**
** TYPE may be: all, ci (show checkins only), t (show tickets only),
** w (show wiki only). LIMIT is the number of items to show.
**
** tkt=UUID filters for only those events for the specified ticket. tag=TAG
** filters for a tag, and wiki=NAME for a wiki page. Only one may be used.
**
** In addition, name=FILENAME filters for a specific file. This may be
** combined with one of the other filters (useful for looking at a specific
** branch).
*/
void page_timeline_rss(void){
Stmt q;
int nLine=0;
char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0;
Blob bSQL;
const char *zType = PD("y","all"); /* Type of events. All if NULL */
const char *zTicketUuid = PD("tkt",NULL);
const char *zTag = PD("tag",NULL);
const char *zFilename = PD("name",NULL);
const char *zWiki = PD("wiki",NULL);
int nLimit = atoi(PD("n","20"));
int nTagId;
const char zSQL1[] =
@ SELECT
@ blob.rid,
@ uuid,
@ event.mtime,
@ coalesce(ecomment,comment),
@ coalesce(euser,user),
|
| ︙ | ︙ | |||
87 88 89 90 91 92 93 |
}
}else if( !g.perm.RdTkt ){
assert( !g.perm.RdTkt &&& g.perm.Read && g.perm.RdWiki );
blob_append(&bSQL, " AND event.type!='t'", -1);
}
}
| | | | > > > > | > > > > > | > > > > > > | > > > > > | > > | > > > | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
}
}else if( !g.perm.RdTkt ){
assert( !g.perm.RdTkt &&& g.perm.Read && g.perm.RdWiki );
blob_append(&bSQL, " AND event.type!='t'", -1);
}
}
if( zTicketUuid ){
nTagId = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",
zTicketUuid);
if ( nTagId==0 ){
nTagId = -1;
}
}else if( zTag ){
nTagId = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'sym-%q*'",
zTag);
if ( nTagId==0 ){
nTagId = -1;
}
}else if( zWiki ){
nTagId = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'wiki-%q*'",
zWiki);
if ( nTagId==0 ){
nTagId = -1;
}
}else{
nTagId = 0;
}
if( nTagId==-1 ){
blob_appendf(&bSQL, " AND 0");
}else if( nTagId!=0 ){
blob_appendf(&bSQL, " AND (EXISTS(SELECT 1 FROM tagxref"
" WHERE tagid=%d AND tagtype>0 AND rid=blob.rid))", nTagId);
}
if( zFilename ){
blob_appendf(&bSQL,
" AND (SELECT mlink.fnid FROM mlink WHERE event.objid=mlink.mid) IN (SELECT fnid FROM filename WHERE name=%Q %s)",
zFilename, filename_collation()
);
}
blob_append( &bSQL, " ORDER BY event.mtime DESC", -1 );
cgi_set_content_type("application/rss+xml");
zProjectName = db_get("project-name", 0);
|
| ︙ | ︙ |