$SQL = "WHERE t.UserID='$UserID'"; break; case 'snatches': if(!check_perms('users_view_seedleech') && $UserID!=$LoggedUser['ID'] && $Paranoia>=2) { error(403); } $SQL = "JOIN xbt_snatched AS x ON t.ID=x.fid WHERE x.uid='$UserID'"; break; case 'seeding': if (!check_perms('users_view_seedleech') && $UserID!=$LoggedUser['ID'] && $Paranoia>=2) { error(403); } $SQL = "JOIN xbt_files_users AS xfu ON t.ID = xfu.fid WHERE xfu.uid='$UserID' AND xfu.remaining = 0"; break; default: error(0); } } ZIP::unlimit(); $DB->query("SELECT DATE_FORMAT(t.Time,'%b \'%y') AS Month, t.GroupID, t.Media, t.Format, t.Encoding, IF(t.RemasterYear=0,tg.Year,t.RemasterYear), tg.Name, t.Size, f.File FROM torrents as t JOIN torrents_group AS tg ON t.GroupID=tg.ID LEFT JOIN torrents_files AS f ON t.ID=f.TorrentID ".$SQL);