Node.js based forum software built for the modern web
added motd support
Julian Lamec463ce3d3aa
diff --git a/config.default.js b/config.default.jsindex e7a662b76b..8c5ad2ac63 100644--- a/config.default.js+++ b/config.default.js@@ -1,3 +1,12 @@+/**+ * READ ME!+ * The config directives here are all different based on where NodeBB is installed.+ * This config file system will be deprecated soon, and all configs will be moved+ * to the redis db, under the hash "config"+ *+ * As of May 22nd, 2013, this migration hasn't started yet+ */+var config = {// The "secret" is used to encrypt cookie sessions, change this to any random string"secret": 'nodebb-secret',diff --git a/public/templates/home.tpl b/public/templates/home.tplindex 736b993be5..f52cd436c7 100644--- a/public/templates/home.tpl+++ b/public/templates/home.tpl@@ -1,11 +1,5 @@<div class="hero-unit">- <h1>NodeBB</h1>- <p>Welcome to NodeBB, the discussion platform of the future.</p>- <p>- <a target="_blank" href="http://www.nodebb.org" class="btn btn-large"><i class="icon-comment"></i> Get NodeBB</a>- <a target="_blank" href="https://github.com/psychobunny/NodeBB" class="btn btn-large"><i class="icon-github-alt"></i> Fork us on Github</a>- <a target="_blank" href="https://twitter.com/dcplabs" class="btn btn-large"><i class="icon-twitter"></i> @dcplabs</a>- </p>+ {motd}</div><div class="row category-row">diff --git a/src/webserver.js b/src/webserver.jsindex 9f6c500a32..e19f50e77f 100644--- a/src/webserver.js+++ b/src/webserver.js@@ -6,9 +6,9 @@ var express = require('express'),config = require('../config.js'),redis = require('redis'),redisServer = redis.createClient(config.redis.port, config.redis.host, config.redis.options),+ marked = require('marked'),user = require('./user.js'),-categories = require('./categories.js'),posts = require('./posts.js'),topics = require('./topics.js'),@@ -18,7 +18,6 @@ var express = require('express'),userRoute = require('./routes/user.js'),auth = require('./routes/authentication.js');-(function(app) {var templates = null;@@ -115,6 +114,7 @@ var express = require('express'),break;case 'home' :categories.getAllCategories(function(data) {+ data.motd = marked(config.motd || "# NodeBB v0.1\nWelcome to NodeBB, the discussion platform of the future.\n\n<a target=\"_blank\" href=\"http://www.nodebb.org\" class=\"btn btn-large\"><i class=\"icon-comment\"></i> Get NodeBB</a> <a target=\"_blank\" href=\"https://github.com/psychobunny/NodeBB\" class=\"btn btn-large\"><i class=\"icon-github-alt\"></i> Fork us on Github</a> <a target=\"_blank\" href=\"https://twitter.com/dcplabs\" class=\"btn btn-large\"><i class=\"icon-twitter\"></i> @dcplabs</a>");res.send(JSON.stringify(data));}, (req.user) ? req.user.uid : 0);break;@@ -191,6 +191,7 @@ var express = require('express'),break;case 'popular' :categories.get(function(data) {+ console.log(data);if(!data) {res.send(false);return;@@ -239,7 +240,7 @@ var express = require('express'),app.get('/test', function(req, res) {categories.get(function(category) {res.send(JSON.stringify(category, null, 4));- }, 2, 2, null, null);+ }, null, 2, null, null);});