mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
popular topics will use topic creation time
This commit is contained in:
@@ -35,8 +35,13 @@ var anonCache = {}, lastUpdateTime = 0;
|
||||
|
||||
categoriesController.popular = function(req, res, next) {
|
||||
var uid = req.user ? req.user.uid : 0;
|
||||
|
||||
var term = req.params.term || 'daily';
|
||||
var terms = {
|
||||
daily: 'day',
|
||||
weekly: 'week',
|
||||
monthly: 'month',
|
||||
alltime: 'alltime'
|
||||
};
|
||||
var term = terms[req.params.term] || 'day';
|
||||
|
||||
if (uid === 0) {
|
||||
if (anonCache[term] && (Date.now() - lastUpdateTime) < 60 * 60 * 1000) {
|
||||
|
||||
Reference in New Issue
Block a user