From b3b811f88913047d3f291b03a5768212722bf855 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 29 Jul 2025 19:29:35 +0300 Subject: [PATCH] Update thanks.php --- library/ajax/thanks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ajax/thanks.php b/library/ajax/thanks.php index 76425ba49..e14a2af89 100644 --- a/library/ajax/thanks.php +++ b/library/ajax/thanks.php @@ -92,7 +92,7 @@ switch ($mode) { // Limit voters per topic $tor_thank_limit_per_topic = (int)$bb_cfg['tor_thank_limit_per_topic']; if ($tor_thank_limit_per_topic > 0) { - $thanks_count = DB()->fetch_row('SELECT COUNT(*) as thx FROM ' . BB_THX . " WHERE topic_id = $topic_id")['thx']; + $thanks_count = count($cached_thanks); if ($thanks_count > $tor_thank_limit_per_topic) { DB()->query('DELETE FROM ' . BB_THX . " WHERE topic_id = $topic_id ORDER BY time ASC LIMIT 1"); }