BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

folders.php 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. #declare(strict_types=1);
  3. if (check_perms('admin_reports') && !empty($_GET['remove']) && is_number($_GET['remove'])) {
  4. $DB->query("
  5. DELETE FROM torrents_bad_folders
  6. WHERE TorrentID = ".$_GET['remove']);
  7. $DB->query("
  8. SELECT GroupID
  9. FROM torrents
  10. WHERE ID = ".$_GET['remove']);
  11. list($GroupID) = $DB->next_record();
  12. $Cache->delete_value('torrents_details_'.$GroupID);
  13. }
  14. if (!empty($_GET['filter']) && $_GET['filter'] == 'all') {
  15. $Join = '';
  16. $All = true;
  17. } else {
  18. $Join = "JOIN xbt_snatched AS x ON x.fid = tbf.TorrentID AND x.uid = ".$LoggedUser['ID'];
  19. $All = false;
  20. }
  21. View::show_header('Torrents with bad folder names');
  22. $DB->query("
  23. SELECT tbf.TorrentID, t.GroupID
  24. FROM torrents_bad_folders AS tbf
  25. JOIN torrents AS t ON t.ID = tbf.TorrentID
  26. $Join
  27. ORDER BY tbf.TimeAdded ASC");
  28. $TorrentsInfo = $DB->to_array('TorrentID', MYSQLI_ASSOC);
  29. foreach ($TorrentsInfo as $Torrent) {
  30. $GroupIDs[] = $Torrent['GroupID'];
  31. }
  32. $Results = Torrents::get_groups($GroupIDs);
  33. ?>
  34. <div class="header">
  35. <?php if ($All) { ?>
  36. <h2>
  37. All torrents trumpable for bad folder names
  38. </h2>
  39. <?php } else { ?>
  40. <h2>
  41. Torrents trumpable for bad folder names that you have snatched
  42. </h2>
  43. <?php } ?>
  44. <div class="linkbox">
  45. <a href="better.php" class="brackets">Back to better.php list</a>
  46. <?php if ($All) { ?>
  47. <a href="better.php?method=folders" class="brackets">Show only those you have snatched</a>
  48. <?php } else { ?>
  49. <a href="better.php?method=folders&amp;filter=all" class="brackets">Show all</a>
  50. <?php } ?>
  51. </div>
  52. </div>
  53. <div class="box pad">
  54. <h3>
  55. There are <?=number_format(count($TorrentsInfo))?> torrents
  56. remaining
  57. </h3>
  58. <table class="torrent_table">
  59. <?php
  60. foreach ($TorrentsInfo as $TorrentID => $Info) {
  61. extract(Torrents::array_group($Results[$Info['GroupID']]));
  62. $TorrentTags = new Tags($TagList);
  63. if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
  64. unset($ExtendedArtists[2]);
  65. unset($ExtendedArtists[3]);
  66. $DisplayName = Artists::display_artists($ExtendedArtists);
  67. } else {
  68. $DisplayName = '';
  69. }
  70. $DisplayName .= "<a href='torrents.php?id=$GroupID&amp;torrentid=$TorrentID#torrent$TorrentID'>$GroupName</a>";
  71. if ($GroupYear > 0) {
  72. $DisplayName .= " [$GroupYear]";
  73. }
  74. $ExtraInfo = Torrents::torrent_info($Torrents[$TorrentID]);
  75. if ($ExtraInfo) {
  76. $DisplayName .= ' - '.$ExtraInfo;
  77. } ?>
  78. <tr
  79. class="torrent torrent_row<?=$Torrents[$TorrentID]['IsSnatched'] ? ' snatched_torrent' : ''?>">
  80. <td>
  81. <span class="torrent_links_block">
  82. <a href="torrents.php?action=download&amp;id=<?=$TorrentID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>"
  83. class="brackets tooltip" title="Download">DL</a>
  84. </span>
  85. <?= $DisplayName ?>
  86. <?php if (check_perms('admin_reports')) { ?>
  87. <a href="better.php?method=folders&amp;remove=<?=$TorrentID?>"
  88. class="brackets">X</a>
  89. <?php } ?>
  90. <div class="tags">
  91. <?=$TorrentTags->format()?>
  92. </div>
  93. </td>
  94. </tr>
  95. <?php
  96. } ?>
  97. </table>
  98. </div>
  99. <?php View::show_footer();