Minor improvements (#1539)

* Minor improvements

* Update CHANGELOG.md

* Update thanks.php

* Updated
This commit is contained in:
Roman Kelesidis 2024-07-13 18:25:21 +07:00 committed by GitHub
commit faede91a14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 40 additions and 5 deletions

View file

@ -46,6 +46,18 @@ switch ($mode) {
$columns = 'topic_id, user_id, time';
$values = "$topic_id, {$userdata['user_id']}, " . TIMENOW;
DB()->query('INSERT IGNORE INTO ' . BB_THX . " ($columns) VALUES ($values)");
DB()->query("
DELETE FROM " . BB_THX . "
WHERE user_id IN (
SELECT user_id FROM (
SELECT user_id
FROM " . BB_THX . "
WHERE topic_id = $topic_id
ORDER BY time ASC
LIMIT 1
) AS subquery
) AND (SELECT COUNT(*) FROM " . BB_THX . " WHERE topic_id = $topic_id) > 50;
");
break;
case 'get':
if (IS_GUEST && !$bb_cfg['tor_thanks_list_guests']) {