mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
closes #1964
This commit is contained in:
@@ -4,5 +4,6 @@
|
|||||||
"week": "Week",
|
"week": "Week",
|
||||||
"month": "Month",
|
"month": "Month",
|
||||||
"year": "Year",
|
"year": "Year",
|
||||||
|
"alltime": "All Time",
|
||||||
"no_recent_topics": "There are no recent topics."
|
"no_recent_topics": "There are no recent topics."
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@ categoriesController.recent = function(req, res, next) {
|
|||||||
return next(err);
|
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);
|
res.render('recent', data);
|
||||||
});
|
});
|
||||||
@@ -33,7 +33,7 @@ categoriesController.popular = function(req, res, next) {
|
|||||||
return next(err);
|
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});
|
res.render('popular', {topics: data});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ module.exports = function(Topics) {
|
|||||||
yearly: 'year'
|
yearly: 'year'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (term === 'alltime') {
|
||||||
|
return getAllTimePopular(uid, callback);
|
||||||
|
}
|
||||||
|
|
||||||
var since = terms[term] || 'day';
|
var since = terms[term] || 'day';
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
@@ -45,6 +49,12 @@ module.exports = function(Topics) {
|
|||||||
], callback);
|
], 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) {
|
function getTopics(tids, uid, callback) {
|
||||||
var keys = tids.map(function(tid) {
|
var keys = tids.map(function(tid) {
|
||||||
return 'topic:' + tid;
|
return 'topic:' + tid;
|
||||||
|
|||||||
Reference in New Issue
Block a user