implemented RSS feeds for topics (and days) by simply wrapping the site.rss_action

This commit is contained in:
Michael Platzer 2003-10-29 16:24:09 +00:00
parent 518a568053
commit c1952c0138
2 changed files with 21 additions and 5 deletions

View file

@ -14,4 +14,14 @@ function main_action() {
res.data.title += this.groupname;
res.data.body = this.renderSkinAsString("main");
path.site.renderSkin("page");
}
}
/**
* rss feed for specific days and topics
*/
function rss_action() {
req.data.show = this._prototype;
req.data[this._prototype] = this.groupname;
path.site.rss_action();
return;
}

View file

@ -147,10 +147,16 @@ function rss_action() {
var sdf = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
sdf.setTimeZone(new java.util.SimpleTimeZone(0, "UTC"));
var collection = this.allstories;
if (req.data.show == "all")
collection = this.allcontent;
var size = collection.size();
if (req.data.show == "all") {
var collection = this.allcontent;
} else if (req.data.show == "day") {
var collection = this.get(req.data.day);
} else if (req.data.show == "topic") {
var collection = this.topics.get(req.data.topic);
} else {
var collection = this.allstories;
}
var size = (collection != null) ? collection.size() : 0;
var max = req.data.max ? parseInt(req.data.max) : 7;
max = Math.min(max, size);
max = Math.min(max, 10);