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.0KB

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