Node.js based forum software built for the modern web
upgrade.js - add forum stats widget to homepage footer
psychobunny1b557d4141cf
diff --git a/public/templates/home.tpl b/public/templates/home.tplindex 59e03b9dab..dac82f3a8f 100644--- a/public/templates/home.tpl+++ b/public/templates/home.tpl@@ -48,3 +48,11 @@</div><!-- END categories --></div>++<div widget-area="footer" class="hidden">+ <!-- BEGIN widgets -->+ <div class="footer">+ {widgets.html}+ </div>+ <!-- END widgets -->+</div>\ No newline at end of filediff --git a/src/upgrade.js b/src/upgrade.jsindex 866c079513..cf98d86062 100644--- a/src/upgrade.js+++ b/src/upgrade.js@@ -745,6 +745,26 @@ Upgrade.upgrade = function(callback) {winston.info('[2014/2/20] Adding Recent Replies, Active Users, and Moderator widgets to category sidebar - skipped');next();}+ },+ function(next) {+ thisSchemaDate = new Date(2014, 1, 20, 16, 15).getTime();++ if (schemaDate < thisSchemaDate) {+ updatesMade = true;++ db.setObjectField('widgets:home.tpl', 'footer', JSON.stringify([+ {+ "widget": "forumstats",+ "data": {}+ }+ ]), function(err) {+ winston.info('[2014/2/20] Adding Forum Stats Widget to the Homepage Footer.');+ next(err);+ });+ } else {+ winston.info('[2014/2/20] Adding Forum Stats Widget to the Homepage Footer - skipped');+ next();+ }}// Add new schema updates here// IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema IN LINE 17!!!