|
|
@ -9,6 +9,7 @@ var categoriesController = {},
|
|
|
|
categories = require('../categories'),
|
|
|
|
categories = require('../categories'),
|
|
|
|
topics = require('../topics'),
|
|
|
|
topics = require('../topics'),
|
|
|
|
meta = require('../meta');
|
|
|
|
meta = require('../meta');
|
|
|
|
|
|
|
|
plugins = require('../plugins');
|
|
|
|
|
|
|
|
|
|
|
|
categoriesController.recent = function(req, res, next) {
|
|
|
|
categoriesController.recent = function(req, res, next) {
|
|
|
|
var uid = req.user ? req.user.uid : 0;
|
|
|
|
var uid = req.user ? req.user.uid : 0;
|
|
|
@ -20,8 +21,10 @@ categoriesController.recent = function(req, res, next) {
|
|
|
|
|
|
|
|
|
|
|
|
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
|
|
|
|
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugins.fireHook('filter:category.get', data, uid, function(err, data) {
|
|
|
|
res.render('recent', data);
|
|
|
|
res.render('recent', data);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
categoriesController.popular = function(req, res, next) {
|
|
|
|
categoriesController.popular = function(req, res, next) {
|
|
|
@ -36,7 +39,9 @@ categoriesController.popular = function(req, res, next) {
|
|
|
|
|
|
|
|
|
|
|
|
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
|
|
|
|
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
|
|
|
|
|
|
|
|
|
|
|
|
res.render('popular', {topics: data});
|
|
|
|
plugins.fireHook('filter:category.get', {topics: data}, uid, function(err, data) {
|
|
|
|
|
|
|
|
res.render('popular', data);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -48,8 +53,10 @@ categoriesController.unread = function(req, res, next) {
|
|
|
|
return next(err);
|
|
|
|
return next(err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugins.fireHook('filter:category.get', data, uid, function(err, data) {
|
|
|
|
res.render('unread', data);
|
|
|
|
res.render('unread', data);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
categoriesController.unreadTotal = function(req, res, next) {
|
|
|
|
categoriesController.unreadTotal = function(req, res, next) {
|
|
|
|