mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
closes #1964
This commit is contained in:
@@ -4,5 +4,6 @@
|
||||
"week": "Week",
|
||||
"month": "Month",
|
||||
"year": "Year",
|
||||
"alltime": "All Time",
|
||||
"no_recent_topics": "There are no recent topics."
|
||||
}
|
||||
@@ -17,7 +17,7 @@ categoriesController.recent = function(req, res, next) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
data['feeds:disableRSS'] = meta.config['feeds:disableRSS'] === '1' ? true : false;
|
||||
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
|
||||
|
||||
res.render('recent', data);
|
||||
});
|
||||
@@ -33,7 +33,7 @@ categoriesController.popular = function(req, res, next) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
data['feeds:disableRSS'] = meta.config['feeds:disableRSS'] === '1' ? true : false;
|
||||
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
|
||||
|
||||
res.render('popular', {topics: data});
|
||||
});
|
||||
|
||||
@@ -16,6 +16,10 @@ module.exports = function(Topics) {
|
||||
yearly: 'year'
|
||||
};
|
||||
|
||||
if (term === 'alltime') {
|
||||
return getAllTimePopular(uid, callback);
|
||||
}
|
||||
|
||||
var since = terms[term] || 'day';
|
||||
|
||||
async.waterfall([
|
||||
@@ -45,6 +49,12 @@ module.exports = function(Topics) {
|
||||
], callback);
|
||||
};
|
||||
|
||||
function getAllTimePopular(uid, callback) {
|
||||
Topics.getTopicsFromSet(uid, 'topics:posts', 0, 19, function(err, data) {
|
||||
callback(err, data ? data.topics : null);
|
||||
});
|
||||
}
|
||||
|
||||
function getTopics(tids, uid, callback) {
|
||||
var keys = tids.map(function(tid) {
|
||||
return 'topic:' + tid;
|
||||
|
||||
Reference in New Issue
Block a user