diff --git a/public/templates/admin/settings.tpl b/public/templates/admin/settings.tpl
index 5f334cad02..aa364e4742 100644
--- a/public/templates/admin/settings.tpl
+++ b/public/templates/admin/settings.tpl
@@ -123,7 +123,7 @@
diff --git a/public/templates/category.tpl b/public/templates/category.tpl
index 8b56a89107..30dd871851 100644
--- a/public/templates/category.tpl
+++ b/public/templates/category.tpl
@@ -10,12 +10,13 @@
-
+
+
diff --git a/src/categories.js b/src/categories.js
index ac65ae2405..b511ede803 100644
--- a/src/categories.js
+++ b/src/categories.js
@@ -80,6 +80,7 @@ var db = require('./database.js'),
'category_id': category_id,
'active_users': [],
'topics': [],
+ 'disableSocialButtons': meta.config.disableSocialButtons !== undefined ? parseInt(meta.config.disableSocialButtons, 10) !== 0 : false,
'twitter-intent-url': 'https://twitter.com/intent/tweet?url=' + encodeURIComponent(nconf.get('url') + 'category/' + category_slug) + '&text=' + encodeURIComponent(category_name),
'facebook-share-url': 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(nconf.get('url') + 'category/' + category_slug),
'google-share-url': 'https://plus.google.com/share?url=' + encodeURIComponent(nconf.get('url') + 'category/' + category_slug),
diff --git a/src/logger.js b/src/logger.js
index eac28782d7..6ee2775255 100644
--- a/src/logger.js
+++ b/src/logger.js
@@ -3,11 +3,12 @@
*/
var fs = require('fs'),
+ path = require('path'),
express = require('express'),
winston = require('winston'),
util = require('util'),
socketio = require('socket.io'),
- meta = require('./meta.js');
+ meta = require('./meta');
var opts = {
/*
@@ -72,10 +73,20 @@ var opts = {
/* Open the streams to log to: either a path or stdout */
var stream;
if(value && fs.existsSync(value)) {
- stream = fs.createWriteStream(value, {flags: 'a'});
- }
- else
+ fs.stat(value, function(err, stats) {
+ if(stats.isDirectory()) {
+ stream = fs.createWriteStream(path.join(value, 'nodebb.log'), {flags: 'a'});
+ } else {
+ stream = fs.createWriteStream(value, {flags: 'a'});
+ }
+ stream.on('error', function(err) {
+ winston.error(err.message);
+ });
+ });
+
+ } else {
stream = process.stdout;
+ }
return stream;
}
@@ -112,8 +123,7 @@ var opts = {
*/
if(meta.config.loggerStatus > 0) {
return opts.express.ofn(req,res,next);
- }
- else {
+ } else {
return next();
}
}
@@ -140,11 +150,13 @@ var opts = {
for(var v in clients) {
var client = clients[v];
- if(client.oEmit != undefined && client.oEmit != client.emit)
+ if(client.oEmit != undefined && client.oEmit != client.emit) {
client.emit = client.oEmit;
+ }
- if(client.$oEmit != undefined && client.$oEmit != client.$emit)
+ if(client.$oEmit != undefined && client.$oEmit != client.$emit) {
client.$emit = client.$oEmit;
+ }
}
}
diff --git a/src/routes/api.js b/src/routes/api.js
index 3f0dbc270c..c637dd58f5 100644
--- a/src/routes/api.js
+++ b/src/routes/api.js
@@ -66,7 +66,7 @@ var path = require('path'),
data.motd_class = (parseInt(meta.config.show_motd, 10) === 1 || meta.config.show_motd === undefined) ? '' : ' none';
data.motd_class += (meta.config.motd && meta.config.motd.length > 0 ? '' : ' default');
- data.motd = require('marked')(meta.config.motd || "
\n\n# NodeBB
v" + pkg.version + "\nWelcome to NodeBB, the discussion platform of the future.");
+ data.motd = require('marked')(meta.config.motd || "
\n\n# NodeBB
v" + pkg.version + "\nWelcome to NodeBB, the discussion platform of the future.");
res.json(data);
});
});