Minor improvements (#1544)

* Update thanks.php

* Update User.php

* Update User.php

* Update User.php

* Revert "Update User.php"

This reverts commit 8ea96c2224.

* Revert "Update User.php"

This reverts commit 736b3209bf.

* Update User.php

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-07-18 20:27:33 +07:00 committed by GitHub
commit 7b3661cb3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View file

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