function bytesToGiB($bytes) {
if ($bytes > 1048576) {
$GiB = $bytes / 1073741824;
} else {
$GiB = 0;
}
return $GiB;
}
$Username = $LoggedUser['Username'];
View::show_header($Username." > Bonus Rates");
$activeTorrents = array();
$DB->query("
SELECT x.timespent,
t.GroupID,
t.Media,
t.Container,
t.Codec,
t.Resolution,
t.AudioFormat,
t.Size,
t.Seeders,
t.Recorded,
us.SeedTime,
(us.SeedTime/60/60) AS hours,
(us.SeedTime/60/60/24) AS days,
tg.Name AS Album,
ag.Name AS Artist
FROM xbt_files_users AS x
LEFT JOIN torrents AS t ON t.ID=x.fid
LEFT JOIN users_seedtime AS us ON x.fid=us.TorrentID AND x.uid=us.UserID
LEFT JOIN torrents_group AS tg ON t.GroupID=tg.ID
LEFT JOIN torrents_artists AS ta ON t.GroupID=ta.GroupID
LEFT JOIN artists_group AS ag ON ta.ArtistID=ag.ArtistID
WHERE x.uid = $UserID AND x.active=1");
while ($result = $DB->next_record()) {
$activeTorrents[] = $result;
}
$totals = [
'torrents' => 0,
'size' => 0,
'points' => 0,
];
//print_r($activeTorrents); die();
?>