mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Update thanks.php
This commit is contained in:
parent
f25c95f7e4
commit
61ffff31e2
1 changed files with 10 additions and 1 deletions
|
@ -94,7 +94,16 @@ switch ($mode) {
|
|||
if ($tor_thank_limit_per_topic > 0) {
|
||||
$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");
|
||||
$oldest_user_id = null;
|
||||
foreach ($cached_thanks as $user_id) {
|
||||
$oldest_user_id = $user_id;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($oldest_user_id) {
|
||||
DB()->query('DELETE FROM ' . BB_THX . " WHERE topic_id = $topic_id AND user_id = $oldest_user_id LIMIT 1");
|
||||
unset($cached_thanks[$oldest_user_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue