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.

covers.php 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. declare(strict_types=1);
  3. if (!empty($_GET['filter']) && $_GET['filter'] === 'all') {
  4. $Join = '';
  5. $All = true;
  6. } else {
  7. $Join = "
  8. JOIN `torrents` AS t
  9. ON
  10. t.`GroupID` = tg.`id`
  11. JOIN `xbt_snatched` AS x
  12. ON
  13. x.`fid` = t.`ID` AND x.`uid` = $LoggedUser[ID]
  14. ";
  15. $All = false;
  16. }
  17. $DB->query("
  18. SELECT SQL_CALC_FOUND_ROWS
  19. tg.`id`
  20. FROM
  21. `torrents_group` AS tg
  22. $Join
  23. WHERE
  24. tg.`picture` = ''
  25. ORDER BY
  26. RAND()
  27. LIMIT 20
  28. ");
  29. $Groups = $DB->to_array('id', MYSQLI_ASSOC);
  30. $DB->query('SELECT FOUND_ROWS()');
  31. list($NumResults) = $DB->next_record();
  32. $Results = Torrents::get_groups(array_keys($Groups));
  33. View::show_header('Torrent groups with no picture');
  34. ?>
  35. <div class="header">
  36. <?php if ($All) { ?>
  37. <h2>
  38. All torrent groups with no picture
  39. </h2>
  40. <?php } else { ?>
  41. <h2>
  42. Torrent groups with no picture that you have snatched
  43. </h2>
  44. <?php } ?>
  45. <div class="linkbox">
  46. <a href="better.php" class="brackets">Back to better.php list</a>
  47. <?php if ($All) { ?>
  48. <a href="better.php?method=covers" class="brackets">Show only those you have snatched</a>
  49. <?php } else { ?>
  50. <a href="better.php?method=covers&amp;filter=all" class="brackets">Show all</a>
  51. <?php } ?>
  52. </div>
  53. </div>
  54. <div class="box pad">
  55. <h3>
  56. There are <?=number_format($NumResults)?> groups remaining
  57. </h3>
  58. <table class="torrent_table">
  59. <?php
  60. foreach ($Results as $Result) {
  61. extract($Result);
  62. $TorrentTags = new Tags($tag_list);
  63. $DisplayName = "<a href='torrents.php?id=$id' ";
  64. if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
  65. $DisplayName .= 'data-cover="'.ImageTools::process($picture, 'thumb').'" ';
  66. }
  67. $DisplayName .= ">$title</a>";
  68. if ($published) {
  69. $DisplayName .= " [$published]";
  70. } ?>
  71. <tr class="torrent">
  72. <td>
  73. <div class="<?=Format::css_category($category_id)?>"></div>
  74. </td>
  75. <td>
  76. <?=$DisplayName?>
  77. <div class="tags">
  78. <?=$TorrentTags->format()?>
  79. </div>
  80. </td>
  81. </tr>
  82. <?php
  83. } ?>
  84. </table>
  85. </div>
  86. <?php View::show_footer();