From 7f246a09d2ebf8c18d6cfcb8de3133a71d2cd131 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Thu, 4 Sep 2025 18:08:04 -0700 Subject: [PATCH] OnlyShow filter fix --- database/getMarketplaceIcons.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/database/getMarketplaceIcons.php b/database/getMarketplaceIcons.php index 7798a5f..2cb95e8 100644 --- a/database/getMarketplaceIcons.php +++ b/database/getMarketplaceIcons.php @@ -14,6 +14,7 @@ $searchForEnabled = isset($post['searchForEnabled']) ? (string)$post['searchForE $searchForValue = (string)$post['searchForValue'] ?? ''; $onlyShowEnabled = isset($post['onlyShowEnabled']) ? (string)$post['onlyShowEnabled'] == 'False' ? false : true : false; $onlyShowValue = (string)$post['onlyShowValue'] ?? ''; +$currentIcons = json_decode(base64_decode((string)($post['currentIcons'] ?? 'W10K'))); $where = ["u.banned = 0", "(c.state = 1 OR c.state = 2)"]; $params = []; @@ -47,6 +48,16 @@ if ($onlyShowEnabled) { $where[] = "c.userId != ?"; $params[] = $userId; $types .= "i"; + } elseif ($onlyShowValue === '2') { + $placeholders = implode(',', array_fill(0, count($currentIcons), '?')); + $where[] = "c.uuid IN ($placeholders)"; + $params = array_merge($params, $currentIcons); + $types .= str_repeat('s', count($currentIcons)); + } elseif ($onlyShowValue === '3') { + $placeholders = implode(',', array_fill(0, count($currentIcons), '?')); + $where[] = "c.uuid NOT IN ($placeholders)"; + $params = array_merge($params, $currentIcons); + $types .= str_repeat('s', count($currentIcons)); } }