From 1762f71a08b914b069aa4ca12148d730d66b53ba Mon Sep 17 00:00:00 2001 From: ruan Date: Thu, 8 Sep 2016 06:55:45 +0200 Subject: [PATCH] Another fix for IP bans --- inc/page.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/inc/page.php b/inc/page.php index cc3a170..5db4c0e 100644 --- a/inc/page.php +++ b/inc/page.php @@ -114,7 +114,7 @@ class Page { function run_query() { try { $table = $this->table; - $active_query = $this->settings->active_query; + $where = $this->settings->active_query; $limit = $this->settings->limit_per_page; $offset = 0; @@ -125,7 +125,14 @@ class Page { $sel = $this->get_selection($table); - $query = "SELECT $sel FROM $table $active_query GROUP BY $table.id ORDER BY time DESC LIMIT :limit OFFSET :offset"; + if ($where !== "") { + $where .= " OR "; + } else { + $where = "WHERE "; + } + $where .= "(uuid <> '#offline#' AND uuid IS NOT NULL)"; + + $query = "SELECT $sel FROM $table $where GROUP BY $table.id ORDER BY time DESC LIMIT :limit OFFSET :offset"; $st = $this->conn->prepare($query); $st->bindParam(':offset', $offset, PDO::PARAM_INT);