mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 10:37:30 -07:00
Vote button and v2 file list topic url display (#1138)
This commit is contained in:
parent
70988814c5
commit
3dedb7e33d
8 changed files with 163 additions and 2 deletions
|
@ -35,6 +35,19 @@ 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue