#-----[ REPLACE WITH ]---------------------------------
#
// Get PER TORRENT user's dlstat from tracker
$db->query("
INSERT INTO ". NEW_BT_LAST_TORSTAT_TABLE ."
(topic_id, user_id, dl_status, up_add, down_add, release_add, seed_time_add, seeder, speed_up, speed_down)
SELECT
topic_id, user_id, IF(releaser, $releaser, seeder), SUM(up_add), SUM(down_add), IF(releaser, SUM(up_add), 0), SUM(seed_time_add), seeder, SUM(speed_up), SUM(speed_down)
FROM ". BT_TRACKER_TABLE ."
WHERE (up_add != 0 OR down_add != 0 OR seed_time_add != 0)
GROUP BY topic_id, user_id
");
// Reset up/down additions in tracker
$db->query("UPDATE ". BT_TRACKER_TABLE ." SET up_add = 0, down_add = 0, seed_time_add = 0");