diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index 116a43bd..731e4ac6 100644 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -166,6 +166,13 @@ $aSettings['statistics'][] = array( 'name' => 'statistics_analytics_code', 'value' => $setting->getValue('statistics_analytics_code'), 'tooltip' => '.' ); +$aSettings['acl'][] = array( + 'display' => 'Hide news post author', 'type' => 'select', + 'options' => array( 0 => 'No', 1 => 'Yes' ), + 'default' => 0, + 'name' => 'acl_hide_news_author', 'value' => $setting->getValue('acl_hide_news_author'), + 'tooltip' => 'Should the news author username be hidden.' +); $aSettings['acl'][] = array( 'display' => 'Pool Statistics', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public'), diff --git a/public/include/pages/home.inc.php b/public/include/pages/home.inc.php index 349b197d..ea85e43b 100644 --- a/public/include/pages/home.inc.php +++ b/public/include/pages/home.inc.php @@ -16,6 +16,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $aNews[$key]['content'] = Markdown::defaultTransform($aData['content']); } } + + $smarty->assign("HIDEAUTHOR", $setting->getValue('acl_hide_news_author')); $smarty->assign("NEWS", $aNews); } else { $debug->append('Using cached page', 3); diff --git a/public/include/pages/news.inc.php b/public/include/pages/news.inc.php index 127b1775..6e7a90c7 100644 --- a/public/include/pages/news.inc.php +++ b/public/include/pages/news.inc.php @@ -16,6 +16,7 @@ if (is_array($aNews)) { } // Tempalte specifics +$smarty->assign("HIDEAUTHOR", $settings->getValue('acl_hide_news_author')); $smarty->assign("NEWS", $aNews); $smarty->assign("CONTENT", "default.tpl"); ?> diff --git a/public/templates/mpos/home/default.tpl b/public/templates/mpos/home/default.tpl index 4c03a85e..d9fe2593 100644 --- a/public/templates/mpos/home/default.tpl +++ b/public/templates/mpos/home/default.tpl @@ -1,6 +1,6 @@ {section name=news loop=$NEWS}
-

{$NEWS[news].header}, posted {$NEWS[news].time|date_format:"%b %e, %Y at %H:%M"} by {$NEWS[news].author}

+

{$NEWS[news].header}, posted {$NEWS[news].time|date_format:"%b %e, %Y at %H:%M"}{if $HIDEAUTHOR|default:"0" == 0} by {$NEWS[news].author}{/if}

{$NEWS[news].content}