Skip to content

Node.js based forum software built for the modern web

closes #2687

barisusakli25ccc573c015
diff --git a/src/controllers/admin.js b/src/controllers/admin.js
index 6779185f0a..f03b7fdb88 100644
--- a/src/controllers/admin.js
+++ b/src/controllers/admin.js
@@ -113,11 +113,17 @@ function getStatsForSet(set, field, callback) {
db.sortedSetCount(set, now - terms.month, now, next);
},
alltime: function(next) {
- db.getObjectField('global', field, next);
+ getGlobalField(field, next);
}
}, callback);
}
+function getGlobalField(field, callback) {
+ db.getObjectField('global', field, function(err, count) {
+ callback(err, parseInt(count, 10) || 0);
+ });
+}
+
adminController.categories.active = function(req, res, next) {
filterAndRenderCategories(req, res, next, true);
};