From 1b557d4141cf427b7916cf6d104955d66794c0e4 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 20 Feb 2014 16:14:24 -0500 Subject: [PATCH] upgrade.js - add forum stats widget to homepage footer --- public/templates/home.tpl | 8 ++++++++ src/upgrade.js | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/public/templates/home.tpl b/public/templates/home.tpl index 59e03b9dab..dac82f3a8f 100644 --- a/public/templates/home.tpl +++ b/public/templates/home.tpl @@ -48,3 +48,11 @@ + + \ No newline at end of file diff --git a/src/upgrade.js b/src/upgrade.js index 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!!!