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.

literature.php 2.2KB

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