Gazelle/sections/better/folders.php

99 lines
3.1 KiB
PHP
Raw Normal View History

2013-02-22 08:00:24 +00:00
<?php
2011-03-28 14:21:28 +00:00
2013-05-05 08:00:31 +00:00
if (check_perms('admin_reports') && !empty($_GET['remove']) && is_number($_GET['remove'])) {
2013-06-18 08:00:48 +00:00
$DB->query("
DELETE FROM torrents_bad_folders
WHERE TorrentID = ".$_GET['remove']);
$DB->query("
SELECT GroupID
FROM torrents
WHERE ID = ".$_GET['remove']);
2011-03-28 14:21:28 +00:00
list($GroupID) = $DB->next_record();
$Cache->delete_value('torrents_details_'.$GroupID);
}
2013-06-18 08:00:48 +00:00
if (!empty($_GET['filter']) && $_GET['filter'] == 'all') {
2013-05-05 08:00:31 +00:00
$Join = '';
2011-03-28 14:21:28 +00:00
$All = true;
} else {
2013-11-17 08:00:47 +00:00
$Join = "JOIN xbt_snatched AS x ON x.fid = tbf.TorrentID AND x.uid = ".$LoggedUser['ID'];
2011-03-28 14:21:28 +00:00
$All = false;
}
2012-10-11 08:00:15 +00:00
View::show_header('Torrents with bad folder names');
2013-05-05 08:00:31 +00:00
$DB->query("
SELECT tbf.TorrentID, t.GroupID
FROM torrents_bad_folders AS tbf
JOIN torrents AS t ON t.ID = tbf.TorrentID
$Join
ORDER BY tbf.TimeAdded ASC");
2011-03-28 14:21:28 +00:00
$TorrentsInfo = $DB->to_array('TorrentID', MYSQLI_ASSOC);
2013-05-05 08:00:31 +00:00
foreach ($TorrentsInfo as $Torrent) {
2011-03-28 14:21:28 +00:00
$GroupIDs[] = $Torrent['GroupID'];
}
2012-10-11 08:00:15 +00:00
$Results = Torrents::get_groups($GroupIDs);
2011-03-28 14:21:28 +00:00
?>
2012-08-19 08:00:19 +00:00
<div class="header">
2013-05-05 08:00:31 +00:00
<? if ($All) { ?>
2013-02-09 08:01:01 +00:00
<h2>All torrents trumpable for bad folder names</h2>
2011-03-28 14:21:28 +00:00
<? } else { ?>
2013-02-09 08:01:01 +00:00
<h2>Torrents trumpable for bad folder names that you have snatched</h2>
2011-03-28 14:21:28 +00:00
<? } ?>
2012-08-19 08:00:19 +00:00
<div class="linkbox">
2013-02-23 08:00:22 +00:00
<a href="better.php" class="brackets">Back to better.php list</a>
2013-05-05 08:00:31 +00:00
<? if ($All) { ?>
2013-02-09 08:01:01 +00:00
<a href="better.php?method=folders" class="brackets">Show only those you have snatched</a>
2011-03-28 14:21:28 +00:00
<? } else { ?>
2013-02-09 08:01:01 +00:00
<a href="better.php?method=folders&amp;filter=all" class="brackets">Show all</a>
2011-03-28 14:21:28 +00:00
<? } ?>
2012-08-19 08:00:19 +00:00
</div>
</div>
2011-03-28 14:21:28 +00:00
<div class="thin box pad">
2013-02-23 08:00:22 +00:00
<h3>There are <?=number_format(count($TorrentsInfo))?> torrents remaining</h3>
2012-09-01 08:00:24 +00:00
<table class="torrent_table">
2011-03-28 14:21:28 +00:00
<?
2012-12-06 08:00:17 +00:00
foreach ($TorrentsInfo as $TorrentID => $Info) {
2013-02-25 21:16:55 +00:00
extract(Torrents::array_group($Results[$Info['GroupID']]));
$TorrentTags = new Tags($TagList);
2012-12-06 08:00:17 +00:00
if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
unset($ExtendedArtists[2]);
unset($ExtendedArtists[3]);
$DisplayName = Artists::display_artists($ExtendedArtists);
} else {
$DisplayName = '';
2011-03-28 14:21:28 +00:00
}
2014-05-01 08:00:45 +00:00
$DisplayName .= "<a href=\"torrents.php?id=$GroupID&amp;torrentid=$TorrentID#torrent$TorrentID\" class=\"tooltip\" title=\"View torrent group\" dir=\"ltr\">$GroupName</a>";
2013-05-05 08:00:31 +00:00
if ($GroupYear > 0) {
2013-06-18 08:00:48 +00:00
$DisplayName .= " [$GroupYear]";
2013-05-05 08:00:31 +00:00
}
if ($ReleaseType > 0) {
2013-06-18 08:00:48 +00:00
$DisplayName .= ' ['.$ReleaseTypes[$ReleaseType].']';
2013-05-05 08:00:31 +00:00
}
2012-12-06 08:00:17 +00:00
2012-10-11 08:00:15 +00:00
$ExtraInfo = Torrents::torrent_info($Torrents[$TorrentID]);
2013-05-05 08:00:31 +00:00
if ($ExtraInfo) {
2013-06-18 08:00:48 +00:00
$DisplayName .= ' - '.$ExtraInfo;
2011-03-28 14:21:28 +00:00
}
?>
2013-02-23 08:00:22 +00:00
<tr class="torrent torrent_row<?=$Torrents[$TorrentID]['IsSnatched'] ? ' snatched_torrent' : ''?>">
2012-12-06 08:00:17 +00:00
<td>
<span class="torrent_links_block">
2013-10-26 08:00:58 +00:00
<a href="torrents.php?action=download&amp;id=<?=$TorrentID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" class="brackets tooltip" title="Download">DL</a>
2012-12-06 08:00:17 +00:00
</span>
<?=$DisplayName?>
<? if (check_perms('admin_reports')) { ?>
2013-02-09 08:01:01 +00:00
<a href="better.php?method=folders&amp;remove=<?=$TorrentID?>" class="brackets">X</a>
2011-03-28 14:21:28 +00:00
<? } ?>
2013-02-25 21:16:55 +00:00
<div class="tags"><?=$TorrentTags->format()?></div>
2012-12-06 08:00:17 +00:00
</td>
</tr>
<? } ?>
2011-03-28 14:21:28 +00:00
</table>
</div>
<?
2012-10-11 08:00:15 +00:00
View::show_footer();
2011-03-28 14:21:28 +00:00
?>