Minor improvements (#1532)

* Minor improvements

* Update clean_dlstat.php

* Updated

* Update usercp_viewprofile.tpl

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-07-10 23:48:31 +07:00 committed by GitHub
commit d2a1a7f5f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 4 additions and 18 deletions

View file

@ -35,19 +35,6 @@ if ($delete_dlstat_sql = implode(') OR (', $delete_dlstat_sql)) {
DB()->query("DELETE QUICK FROM " . BB_BT_DLSTATUS . " WHERE ($delete_dlstat_sql)");
}
// Save the last 50 votes for topics
DB()->query('
DELETE t1
FROM ' . BB_THX . ' t1
JOIN (
SELECT topic_id, MAX(time) as max_time
FROM ' . BB_THX . '
GROUP BY topic_id
HAVING COUNT(*) > 50
) t2
ON t1.topic_id = t2.topic_id AND t1.time = t2.max_time;
');
// Delete orphans
DB()->query("
DELETE QUICK dl