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.

screenshots.php 2.1KB

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