[ADDED] ACL to hide news post author

This will allow admins to hide the actual username/author from their newsposts.
Useful if you don't wish to give your admin account away or in case you
have no admin-only account.
This commit is contained in:
Sebastian Grewe 2013-12-07 22:30:27 +01:00
parent 8fbad03457
commit bb55001db7
4 changed files with 11 additions and 1 deletions

View File

@ -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'),

View File

@ -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);

View File

@ -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");
?>

View File

@ -1,6 +1,6 @@
{section name=news loop=$NEWS}
<article class="module width_full">
<header><h3>{$NEWS[news].header}, <font size=\"1px\">posted {$NEWS[news].time|date_format:"%b %e, %Y at %H:%M"} by <b>{$NEWS[news].author}</b></font></h3></header>
<header><h3>{$NEWS[news].header}, <font size=\"1px\">posted {$NEWS[news].time|date_format:"%b %e, %Y at %H:%M"}{if $HIDEAUTHOR|default:"0" == 0} by <b>{$NEWS[news].author}</b>{/if}</font></h3></header>
<div class="module_content">
{$NEWS[news].content}
<div class="clear"></div>