mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-03-01 00:00:49 +01:00
Make ban list faster for board owners/vols
This commit is contained in:
parent
ed73fd525e
commit
df7c7c8454
@ -156,17 +156,16 @@ class Bans {
|
|||||||
|
|
||||||
static public function stream_json($out = false, $filter_ips = false, $filter_staff = false, $board_access = false) {
|
static public function stream_json($out = false, $filter_ips = false, $filter_staff = false, $board_access = false) {
|
||||||
global $config, $pdo;
|
global $config, $pdo;
|
||||||
|
|
||||||
|
|
||||||
if ($board_access && $board_access[0] == '*') $board_access = false;
|
if ($board_access && $board_access[0] == '*') $board_access = false;
|
||||||
|
|
||||||
$query_addition = "";
|
$query_addition = "";
|
||||||
if ($board_access !== FALSE) {
|
|
||||||
$query_addition .= "WHERE `public_bans` OR `public_bans` IS NULL";
|
|
||||||
}
|
|
||||||
if ($board_access) {
|
if ($board_access) {
|
||||||
$boards = implode(", ", array_map(array($pdo, "quote"), $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``
|
$query = query("SELECT ``bans``.*, `username`, `type` FROM ``bans``
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<div class='banlist-opts'>
|
<div class='banlist-opts'>
|
||||||
<div class='checkboxes'>
|
<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>
|
<label><input type="checkbox" id="only_not_expired"> {% trans %}Show only active bans{% endtrans %}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class='buttons'>
|
<div class='buttons'>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user