Skip to content

Commit

Permalink
added option for showing the mod in ban page.
Browse files Browse the repository at this point in the history
also fixes issue where the Staff is not shown in ban appeals.
  • Loading branch information
juanchan committed Aug 31, 2014
1 parent f7b6693 commit 53ada6a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions inc/config.php
Expand Up @@ -579,6 +579,9 @@
// How many ban appeals can be made for a single ban?
$config['ban_appeals_max'] = 1;

// Show moderator name on ban page.
$config['show_modname'] = false;

/*
* ====================
* Markup settings
Expand Down
4 changes: 2 additions & 2 deletions inc/functions.php
Expand Up @@ -777,8 +777,8 @@ function checkBan($board = false) {

if (event('check-ban', $board))
return true;
$bans = Bans::find($_SERVER['REMOTE_ADDR'], $board);

$bans = Bans::find($_SERVER['REMOTE_ADDR'], $board, $config['show_modname']);

foreach ($bans as &$ban) {
if ($ban['expires'] && $ban['expires'] < time()) {
Expand Down
1 change: 1 addition & 0 deletions inc/mod/pages.php
Expand Up @@ -953,6 +953,7 @@ function mod_ban_appeals() {

$query = query("SELECT *, ``ban_appeals``.`id` AS `id` FROM ``ban_appeals``
LEFT JOIN ``bans`` ON `ban_id` = ``bans``.`id`
LEFT JOIN ``mods`` ON ``bans``.`creator` = ``mods``.`id`
WHERE `denied` != 1 ORDER BY `time`") or error(db_error());
$ban_appeals = $query->fetchAll(PDO::FETCH_ASSOC);
foreach ($ban_appeals as &$ban) {
Expand Down
10 changes: 9 additions & 1 deletion templates/banned.html
Expand Up @@ -30,7 +30,15 @@ <h2>{% trans %}You are banned! ;_;{% endtrans %}</h2>
{% endif %}
<p>
{% trans %}Your ban was filed on{% endtrans %}
<strong>{{ ban.created|date(config.ban_date) }}</strong> {% trans %}and{% endtrans %} <span id="expires">
<strong>{{ ban.created|date(config.ban_date) }}</strong>
{% if config.show_modname %}
{% if ban.username %}
{% trans %}by{% endtrans %} <strong> {{ ban.username }} </strong>
{% else %}
{% trans %}by{% endtrans %} <em> 'system' </em>
{% endif %}
{% endif %}
{% trans %}and{% endtrans %} <span id="expires">
{% if ban.expires and time() >= ban.expires %}
{% trans %} has since expired. Refresh the page to continue.{% endtrans %}
{% elseif ban.expires %}
Expand Down

0 comments on commit 53ada6a

Please sign in to comment.