diff options
| author | Fredrick Brennan <admin@8chan.co> | 2014-09-01 10:33:47 -0400 |
|---|---|---|
| committer | Fredrick Brennan <admin@8chan.co> | 2014-09-01 10:33:47 -0400 |
| commit | 39cecea5795fd827432593c81e54f2bf181d02ce (patch) | |
| tree | 03e7a8e79fef845f4ad0d24d1861c01bdbfe0e52 | |
| parent | f7b6693c027ae42f791cdadd6625e48a58c732db (diff) | |
| parent | 53ada6a5ff71a04a9970faef7f2623a201a95dc9 (diff) | |
Merge pull request #77 from juanchan/smallfixes
optionally show mod name in templates/banned.html
| -rw-r--r-- | inc/config.php | 3 | ||||
| -rw-r--r-- | inc/functions.php | 4 | ||||
| -rw-r--r-- | inc/mod/pages.php | 1 | ||||
| -rw-r--r-- | templates/banned.html | 10 |
4 files changed, 15 insertions, 3 deletions
diff --git a/inc/config.php b/inc/config.php index 41cbbd12..1525b8bb 100644 --- a/inc/config.php +++ b/inc/config.php @@ -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 diff --git a/inc/functions.php b/inc/functions.php index a88e8fc8..2e16c419 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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()) { diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 292d36a2..c21086ed 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -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) { diff --git a/templates/banned.html b/templates/banned.html index 33f9d9f8..b4cdf3f9 100644 --- a/templates/banned.html +++ b/templates/banned.html @@ -30,7 +30,15 @@ {% 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 %} |
