From df7c7c845441df7d34b2da8e7209dd82d4d72081 Mon Sep 17 00:00:00 2001 From: 8chan Date: Mon, 16 Feb 2015 16:19:02 -0800 Subject: [PATCH] Make ban list faster for board owners/vols --- inc/bans.php | 9 ++++----- templates/mod/ban_list.html | 3 --- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/inc/bans.php b/inc/bans.php index e0866ed4..b7a2c201 100644 --- a/inc/bans.php +++ b/inc/bans.php @@ -156,17 +156,16 @@ class Bans { static public function stream_json($out = false, $filter_ips = false, $filter_staff = false, $board_access = false) { global $config, $pdo; - if ($board_access && $board_access[0] == '*') $board_access = false; $query_addition = ""; - if ($board_access !== FALSE) { - $query_addition .= "WHERE `public_bans` OR `public_bans` IS NULL"; - } if ($board_access) { $boards = implode(", ", array_map(array($pdo, "quote"), $board_access)); - $query_addition .= " OR `board` IN (".$boards.")"; + $query_addition .= "WHERE `board` IN (".$boards.")"; + } + if ($board_access !== FALSE) { + $query_addition .= "AND (`public_bans` OR `public_bans` IS NULL)"; } $query = query("SELECT ``bans``.*, `username`, `type` FROM ``bans`` diff --git a/templates/mod/ban_list.html b/templates/mod/ban_list.html index 0c67f269..d43a30a1 100644 --- a/templates/mod/ban_list.html +++ b/templates/mod/ban_list.html @@ -13,9 +13,6 @@ {% endif %}
- {% if mod and mod.boards[0] != '*' %} - - {% endif %}