|
|
|
@ -42,8 +42,9 @@ Controllers.home = function(req, res, next) {
|
|
|
|
|
var hook = 'action:homepage.get:' + route;
|
|
|
|
|
|
|
|
|
|
if (plugins.hasListeners(hook)) {
|
|
|
|
|
plugins.fireHook(hook, {req: req, res: res, next: next});
|
|
|
|
|
} else {
|
|
|
|
|
return plugins.fireHook(hook, {req: req, res: res, next: next});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (route === 'categories' || route === '/') {
|
|
|
|
|
Controllers.categories.list(req, res, next);
|
|
|
|
|
} else if (route === 'recent') {
|
|
|
|
@ -57,12 +58,11 @@ Controllers.home = function(req, res, next) {
|
|
|
|
|
req.params.topic_index = "1";
|
|
|
|
|
req.params.category_id = match[1];
|
|
|
|
|
req.params.slug = match[2];
|
|
|
|
|
Controllers.categories.get(req, res, next);
|
|
|
|
|
Controllers.category.get(req, res, next);
|
|
|
|
|
} else {
|
|
|
|
|
res.redirect(route);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|