Update thanks.php

This commit is contained in:
Roman Kelesidis 2025-07-29 19:29:35 +03:00
commit b3b811f889
No known key found for this signature in database
GPG key ID: D8157C4D4C4C6DB4

View file

@ -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");
}