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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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->prepare_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. $DB->exec_prepared_query();
  30. $Groups = $DB->to_array('id', MYSQLI_ASSOC);
  31. $DB->prepared_query('SELECT FOUND_ROWS()');
  32. list($NumResults) = $DB->next_record();
  33. $Results = Torrents::get_groups(array_keys($Groups));
  34. View::show_header('Torrent groups with no picture');
  35. ?>
  36. <div class="header">
  37. <?php if ($All) { ?>
  38. <h2>
  39. All torrent groups with no picture
  40. </h2>
  41. <?php } else { ?>
  42. <h2>
  43. Torrent groups with no picture that you have snatched
  44. </h2>
  45. <?php } ?>
  46. <div class="linkbox">
  47. <a href="better.php" class="brackets">Back to better.php list</a>
  48. <?php if ($All) { ?>
  49. <a href="better.php?method=covers" class="brackets">Show only those you have snatched</a>
  50. <?php } else { ?>
  51. <a href="better.php?method=covers&amp;filter=all" class="brackets">Show all</a>
  52. <?php } ?>
  53. </div>
  54. </div>
  55. <div class="box pad">
  56. <h3>
  57. There are <?=number_format($NumResults)?> groups remaining
  58. </h3>
  59. <table class="torrent_table">
  60. <?php
  61. foreach ($Results as $Result) {
  62. extract($Result);
  63. $TorrentTags = new Tags($tag_list);
  64. $DisplayName = "<a href='torrents.php?id=$id' ";
  65. if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
  66. $DisplayName .= 'data-cover="'.ImageTools::process($picture, 'thumb').'" ';
  67. }
  68. $DisplayName .= ">$title</a>";
  69. if ($published) {
  70. $DisplayName .= " [$published]";
  71. } ?>
  72. <tr class="torrent">
  73. <td>
  74. <div class="<?=Format::css_category($category_id)?>"></div>
  75. </td>
  76. <td>
  77. <?=$DisplayName?>
  78. <div class="tags">
  79. <?=$TorrentTags->format()?>
  80. </div>
  81. </td>
  82. </tr>
  83. <?php
  84. } ?>
  85. </table>
  86. </div>
  87. <?php View::show_footer();