Oppaitime'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

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