Skip to content

Node.js based forum software built for the modern web

#712

Baris Soner Usakli8bfb338eee88
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 @@
</div>
<div class="checkbox">
<label>
- <input type="checkbox" data-field="disableSocialButtons"> <strong>Disable social buttons on posts</strong>
+ <input type="checkbox" data-field="disableSocialButtons"> <strong>Disable social buttons</strong>
</label>
</div>
<div class="checkbox">
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 @@
<div>
<button id="new_post" class="btn btn-primary {show_topic_button}">[[category:new_topic_button]]</button>
-
+ <!-- IF !disableSocialButtons -->
<div class="inline-block pull-right">
<a href="#" id="facebook-share"><i class="fa fa-facebook-square fa-2x"></i></a>&nbsp;
<a href="#" id="twitter-intent"><i class="fa fa-twitter-square fa-2x"></i></a>&nbsp;
<a href="#" id="google-share"><i class="fa fa-google-plus-square fa-2x"></i></a>&nbsp;
</div>
+ <!-- ENDIF !disableSocialButtons -->
</div>
<hr/>
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),