v1.18.x
barisusakli 11 years ago
commit 06119510b7

@ -1,5 +1,5 @@
# <img alt="NodeBB" src="http://i.imgur.com/mYxPPtB.png" /> # <img alt="NodeBB" src="http://i.imgur.com/mYxPPtB.png" />
[![Build Status](https://travis-ci.org/NodeBB/NodeBB.svg?branch=master)](https://travis-ci.org/nodebb/nodebb) [![Build Status](https://travis-ci.org/NodeBB/NodeBB.svg?branch=master)](https://travis-ci.org/NodeBB/NodeBB)
[![Dependency Status](https://david-dm.org/nodebb/nodebb.svg)](https://david-dm.org/nodebb/nodebb) [![Dependency Status](https://david-dm.org/nodebb/nodebb.svg)](https://david-dm.org/nodebb/nodebb)
[![Code Climate](https://codeclimate.com/github/designcreateplay/NodeBB.png)](https://codeclimate.com/github/designcreateplay/NodeBB) [![Code Climate](https://codeclimate.com/github/designcreateplay/NodeBB.png)](https://codeclimate.com/github/designcreateplay/NodeBB)

@ -67,7 +67,7 @@
"url": "https://github.com/NodeBB/NodeBB/issues" "url": "https://github.com/NodeBB/NodeBB/issues"
}, },
"engines": { "engines": {
"node": ">=0.8" "node": ">=0.10"
}, },
"maintainers": [ "maintainers": [
{ {

@ -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) {

@ -160,7 +160,7 @@ module.exports = function(app, middleware) {
app.render.apply(app, arguments); app.render.apply(app, arguments);
}; };
app.all(relativePath + '/api/*', middleware.updateLastOnlineTime, middleware.prepareAPI); app.all(relativePath + '/api/?*', middleware.updateLastOnlineTime, middleware.prepareAPI);
app.all(relativePath + '/api/admin/*', middleware.admin.isAdmin, middleware.prepareAPI); app.all(relativePath + '/api/admin/*', middleware.admin.isAdmin, middleware.prepareAPI);
app.all(relativePath + '/admin/*', middleware.admin.isAdmin); app.all(relativePath + '/admin/*', middleware.admin.isAdmin);
app.get(relativePath + '/admin', middleware.admin.isAdmin); app.get(relativePath + '/admin', middleware.admin.isAdmin);

Loading…
Cancel
Save