1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-31 12:23:48 +01:00

Make ban list faster for board owners/vols

This commit is contained in:
8chan 2015-02-16 16:19:02 -08:00
parent ed73fd525e
commit df7c7c8454
2 changed files with 4 additions and 8 deletions

View File

@ -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``

View File

@ -13,9 +13,6 @@
{% endif %}
<div class='banlist-opts'>
<div class='checkboxes'>
{% if mod and mod.boards[0] != '*' %}
<label><input type="checkbox" id="only_mine"> {% trans %}Show only bans from boards I moderate{% endtrans %}</label>
{% endif %}
<label><input type="checkbox" id="only_not_expired"> {% trans %}Show only active bans{% endtrans %}</label>
</div>
<div class='buttons'>