mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-14 11:26:26 +00:00
89aa3f46e3
Finished adding [code] tag Merging groups no longer wipes comments Group comments are no longer lost on merge Fixing incorrect equality Added the freeleech_torrents() and freeleech_groups() functions, testing on vanity house addition Implementing new freeleech functions for torrent and group editing Implementing better.php filter for seeding Separating staff and forum staff within staff functions
108 lines
3.2 KiB
PHP
108 lines
3.2 KiB
PHP
<?
|
|
|
|
if(!empty($_GET['userid']) && is_number($_GET['userid'])) {
|
|
if (check_perms('users_override_paranoia')) {
|
|
$UserID = $_GET['userid'];
|
|
} else {
|
|
error(403);
|
|
}
|
|
} else {
|
|
$UserID = $LoggedUser['ID'];
|
|
}
|
|
|
|
if(!empty($_GET['filter']) && $_GET['filter'] == 'seeding') {
|
|
$SeedingOnly = true;
|
|
} else {
|
|
$SeedingOnly = false;
|
|
}
|
|
|
|
// Get list of FLAC snatches
|
|
$DB->query("SELECT t.GroupID, x.fid
|
|
FROM ".($SeedingOnly ? 'xbt_files_users' : 'xbt_snatched')." AS x
|
|
JOIN torrents AS t ON t.ID=x.fid
|
|
WHERE t.Format='FLAC'
|
|
AND ((t.LogScore = '100' AND t.Media = 'CD')
|
|
OR t.Media = 'Vinyl')
|
|
AND x.uid='$UserID'");
|
|
|
|
$SnatchedGroupIDs = $DB->collect('GroupID');
|
|
$Snatches = $DB->to_array('GroupID');
|
|
|
|
if(count($SnatchedGroupIDs) == 0) { error(($SeedingOnly ? "You aren't seeding any 100% FLACs!" : "You haven't snatched any 100% FLACs!")); }
|
|
// Create hash table
|
|
|
|
$DB->query("CREATE TEMPORARY TABLE t
|
|
SELECT t.GroupID,
|
|
GROUP_CONCAT(t.Encoding SEPARATOR ' ') AS EncodingList
|
|
FROM torrents AS t
|
|
WHERE t.GroupID IN(".implode(',',$SnatchedGroupIDs).")
|
|
GROUP BY t.GroupID");
|
|
|
|
//$DB->query('SELECT * FROM t');
|
|
|
|
$DB->query("SELECT GroupID FROM t
|
|
WHERE EncodingList NOT LIKE '%V0 (VBR)%'
|
|
OR EncodingList NOT LIKE '%V2 (VBR)%'
|
|
OR EncodingList NOT LIKE '%320%'");
|
|
|
|
$GroupIDs = $DB->collect('GroupID');
|
|
|
|
if(count($GroupIDs) == 0) { error('No results found'); }
|
|
|
|
$Results = get_groups($GroupIDs);
|
|
|
|
show_header('Transcode Snatches');
|
|
?>
|
|
<div class="linkbox">
|
|
<? if($SeedingOnly) { ?>
|
|
<a href="better.php?method=snatch">Show all</a>
|
|
<? } else { ?>
|
|
<a href="better.php?method=snatch&filter=seeding">Just those currently seeding</a>
|
|
<? } ?>
|
|
</div>
|
|
<div class="thin">
|
|
<table width="100%">
|
|
<tr class="colhead">
|
|
<td>Torrent</td>
|
|
<td>V2</td>
|
|
<td>V0</td>
|
|
<td>320</td>
|
|
</tr>
|
|
<?
|
|
$Results = $Results['matches'];
|
|
foreach ($Results as $GroupID=>$Group) {
|
|
list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $Torrents, $Artists) = array_values($Group);
|
|
$FlacID = $Snatches[$GroupID]['fid'];
|
|
|
|
$DisplayName = '';
|
|
if(count($Artists)>0) {
|
|
$DisplayName = display_artists(array('1'=>$Artists));
|
|
}
|
|
$DisplayName.='<a href="torrents.php?id='.$GroupID.'&torrentid='.$FlacID.'" title="View Torrent">'.$GroupName.'</a>';
|
|
if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
|
|
|
|
$MissingEncodings = array('V0 (VBR)'=>1, 'V2 (VBR)'=>1, '320'=>1);
|
|
|
|
foreach($Torrents as $Torrent) {
|
|
if(!empty($MissingEncodings[$Torrent['Encoding']])) {
|
|
$MissingEncodings[$Torrent['Encoding']] = 0;
|
|
}
|
|
}
|
|
|
|
?>
|
|
<tr>
|
|
<td>
|
|
<?=$DisplayName?>
|
|
[<a href="torrents.php?action=download&id=<?=$FlacID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>">DL</a>]</td>
|
|
<td><strong><?=($MissingEncodings['V2 (VBR)'] == 0)?'<span style="color: green;">YES</span>':'<span style="color: red;">NO</span>'?></strong></td>
|
|
<td><strong><?=($MissingEncodings['V0 (VBR)'] == 0)?'<span style="color: green;">YES</span>':'<span style="color: red;">NO</span>'?></strong></td>
|
|
<td><strong><?=($MissingEncodings['320'] == 0)?'<span style="color: green;">YES</span>':'<span style="color: red;">NO</span>'?></strong>
|
|
</td>
|
|
</tr>
|
|
<? } ?>
|
|
</table>
|
|
</div>
|
|
<?
|
|
show_footer();
|
|
?>
|