|
|
@ -8,7 +8,8 @@ var categoriesController = {},
|
|
|
|
user = require('./../user'),
|
|
|
|
user = require('./../user'),
|
|
|
|
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;
|
|
|
@ -19,8 +20,10 @@ categoriesController.recent = function(req, res, next) {
|
|
|
|
|
|
|
|
|
|
|
|
data['feeds:disableRSS'] = meta.config['feeds:disableRSS'] === '1' ? true : false;
|
|
|
|
data['feeds:disableRSS'] = meta.config['feeds:disableRSS'] === '1' ? true : false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
@ -35,7 +38,9 @@ categoriesController.popular = function(req, res, next) {
|
|
|
|
|
|
|
|
|
|
|
|
data['feeds:disableRSS'] = meta.config['feeds:disableRSS'] === '1' ? true : false;
|
|
|
|
data['feeds:disableRSS'] = meta.config['feeds:disableRSS'] === '1' ? true : false;
|
|
|
|
|
|
|
|
|
|
|
|
res.render('popular', {topics: data});
|
|
|
|
plugins.fireHook('filter:category.get', {topics: data}, uid, function(err, data) {
|
|
|
|
|
|
|
|
res.render('popular', data);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -47,8 +52,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) {
|
|
|
|