diff --git a/public/src/forum/admin/settings.js b/public/src/forum/admin/settings.js index d241508fdc..b384b3b378 100644 --- a/public/src/forum/admin/settings.js +++ b/public/src/forum/admin/settings.js @@ -83,8 +83,8 @@ define(['uploader'], function(uploader) { }); $('#uploadFaviconBtn').on('click', function() { - uploader.open(RELATIVE_PATH + '/admin/uploadfavicon', function() { - $('#favicon').attr('src', './../favicon.ico?v=' + new Date().getTime()); + uploader.open(RELATIVE_PATH + '/admin/uploadfavicon', function(icon) { + $('#faviconUrl').val(icon); }); uploader.hideAlerts(); diff --git a/public/templates/admin/settings.tpl b/public/templates/admin/settings.tpl index 3b9d7b973e..4a72c95fcc 100644 --- a/public/templates/admin/settings.tpl +++ b/public/templates/admin/settings.tpl @@ -18,7 +18,7 @@

-   +

diff --git a/public/templates/header.tpl b/public/templates/header.tpl index f08ff9680f..b726e79288 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -25,8 +25,8 @@ } }); - + diff --git a/src/routes/admin.js b/src/routes/admin.js index 40c3364a36..cd3994f144 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -169,7 +169,7 @@ var nconf = require('nconf'), } var filename = 'favicon.ico'; - var uploadPath = path.join(nconf.get('base_dir'), 'public', filename); + var uploadPath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), filename); winston.info('Attempting upload to: ' + uploadPath); diff --git a/src/webserver.js b/src/webserver.js index ad8614911d..f2a1c4f858 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -90,6 +90,7 @@ var path = require('path'), description: meta.config.description || '', 'brand:logo': meta.config['brand:logo'] || '', 'brand:logo:display': meta.config['brand:logo']?'':'hide', + 'brand:favicon': meta.config['brand:favicon'] || nconf.get('relative_path') + 'favicon.ico', browserTitle: meta.config.title || 'NodeBB', csrf: options.res.locals.csrf_token, relative_path: nconf.get('relative_path'),