implemented RSS feeds for topics (and days) by simply wrapping the site.rss_action
This commit is contained in:
parent
518a568053
commit
c1952c0138
2 changed files with 21 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue