v1.18.x
barisusakli 11 years ago
parent 60624eedec
commit d91fa5747d

@ -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;

Loading…
Cancel
Save