|
|
@ -37,12 +37,14 @@
|
|
|
|
site_url: nconf.get('url') + 'topic/' + topicData.slug,
|
|
|
|
site_url: nconf.get('url') + 'topic/' + topicData.slug,
|
|
|
|
image_url: topicData.main_posts[0].picture,
|
|
|
|
image_url: topicData.main_posts[0].picture,
|
|
|
|
author: topicData.main_posts[0].username,
|
|
|
|
author: topicData.main_posts[0].username,
|
|
|
|
pubDate: new Date(parseInt(topicData.main_posts[0].timestamp, 10)).toUTCString(),
|
|
|
|
|
|
|
|
ttl: Feed.defaults.ttl
|
|
|
|
ttl: Feed.defaults.ttl
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
topic_posts = topicData.main_posts.concat(topicData.posts),
|
|
|
|
topic_posts = topicData.main_posts.concat(topicData.posts),
|
|
|
|
title, postData, dateStamp;
|
|
|
|
title, postData, dateStamp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add pubDate if topic contains posts
|
|
|
|
|
|
|
|
if (topicData.main_posts.length > 0) feed.pubDate = new Date(parseInt(topicData.main_posts[0].timestamp, 10)).toUTCString();
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0, ii = topic_posts.length; i < ii; i++) {
|
|
|
|
for (var i = 0, ii = topic_posts.length; i < ii; i++) {
|
|
|
|
postData = topic_posts[i];
|
|
|
|
postData = topic_posts[i];
|
|
|
|
dateStamp = new Date(parseInt(postData.edited === '0' ? postData.timestamp : postData.edited, 10)).toUTCString();
|
|
|
|
dateStamp = new Date(parseInt(postData.edited === '0' ? postData.timestamp : postData.edited, 10)).toUTCString();
|
|
|
@ -74,12 +76,14 @@
|
|
|
|
description: categoryData.category_description,
|
|
|
|
description: categoryData.category_description,
|
|
|
|
feed_url: Feed.defaults.baseUrl + '/categories/' + cid + '.rss',
|
|
|
|
feed_url: Feed.defaults.baseUrl + '/categories/' + cid + '.rss',
|
|
|
|
site_url: nconf.get('url') + 'category/' + categoryData.category_id,
|
|
|
|
site_url: nconf.get('url') + 'category/' + categoryData.category_id,
|
|
|
|
pubDate: new Date(parseInt(categoryData.topics[0].lastposttime, 10)).toUTCString(),
|
|
|
|
|
|
|
|
ttl: Feed.defaults.ttl
|
|
|
|
ttl: Feed.defaults.ttl
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
topics = categoryData.topics,
|
|
|
|
topics = categoryData.topics,
|
|
|
|
title, topicData, dateStamp;
|
|
|
|
title, topicData, dateStamp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add pubDate if category has topics
|
|
|
|
|
|
|
|
if (categoryData.topics.length > 0) feed.pubDate = new Date(parseInt(categoryData.topics[0].lastposttime, 10)).toUTCString();
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0, ii = topics.length; i < ii; i++) {
|
|
|
|
for (var i = 0, ii = topics.length; i < ii; i++) {
|
|
|
|
topicData = topics[i];
|
|
|
|
topicData = topics[i];
|
|
|
|
dateStamp = new Date(parseInt(topicData.lastposttime, 10)).toUTCString();
|
|
|
|
dateStamp = new Date(parseInt(topicData.lastposttime, 10)).toUTCString();
|
|
|
|