From ba318155945679e69b61ea5c0b256004ae61469f Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 18 Jul 2024 20:08:11 +0700 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 3f55f1c4f..1fd9a83a4 100644 --- a/library/ajax/thanks.php +++ b/library/ajax/thanks.php @@ -48,7 +48,7 @@ switch ($mode) { DB()->query('INSERT IGNORE INTO ' . BB_THX . " ($columns) VALUES ($values)"); // Limit voters per topic - $thanks_count = DB()->fetch_row('SELECT COUNT(*) FROM ' . BB_THX . " WHERE topic_id = $topic_id"); + $thanks_count = DB()->fetch_row('SELECT COUNT(*) as thx FROM ' . BB_THX . " WHERE topic_id = $topic_id")['thx']; if ($thanks_count > (int)$bb_cfg['tor_thank_limit_per_topic']) { DB()->query('DELETE FROM ' . BB_THX . " WHERE topic_id = $topic_id ORDER BY time ASC LIMIT 1"); }