if weblog is offline, display error message as rss item instead of 404 http error.
This commit is contained in:
parent
4b5b1bd851
commit
65d50f8439
1 changed files with 23 additions and 17 deletions
|
@ -1,10 +1,10 @@
|
|||
if (!this.online)
|
||||
res.redirect("notfound");
|
||||
res.contentType = "text/xml";
|
||||
|
||||
var base = "http://" + getProperty("server") + getProperty("baseURI");
|
||||
var now = new Date();
|
||||
var param1 = new Object();
|
||||
|
||||
if (this.online) {
|
||||
var size = this.allstories.size();
|
||||
var max = req.data.max ? req.data.max : 7;
|
||||
if (max > size)
|
||||
|
@ -20,6 +20,13 @@ for (var i=0; i<max; i++) {
|
|||
items += this.renderSkinAsString("rssItem", param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
param1.itemLink = "";
|
||||
param1.itemTitle = encodeXml("Access denied");
|
||||
param1.itemDescription = encodeXml("This weblog is offline.");
|
||||
items = this.renderSkinAsString("rssItem", param1);
|
||||
}
|
||||
|
||||
var param2 = new Object();
|
||||
param2.title = encodeXml(this.title);
|
||||
|
@ -33,5 +40,4 @@ param2.webMaster = this.creator.email;
|
|||
param2.language = this.language;
|
||||
param2.items = items;
|
||||
|
||||
res.contentType = "text/xml";
|
||||
this.renderSkin("rssChannel", param2);
|
||||
|
|
Loading…
Add table
Reference in a new issue