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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 screenshots');
  11. $DB->query("
  12. SELECT
  13. SQL_CALC_FOUND_ROWS
  14. tg.ID
  15. FROM torrents_group AS tg
  16. $Join
  17. WHERE tg.ID NOT IN (SELECT DISTINCT GroupID FROM torrents_screenshots)
  18. AND NOT (tg.CategoryID = 5 AND tg.TagList LIKE \"%audio%\")
  19. ORDER BY RAND()
  20. LIMIT 20"); // TagList clause quintuples query time. Probably needs to be removed in future
  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. <? if ($All) { ?>
  28. <h2>All groups with no screenshots</h2>
  29. <? } else { ?>
  30. <h2>Torrent groups with no screenshots that you have snatched</h2>
  31. <? } ?>
  32. <div class="linkbox">
  33. <a href="better.php" class="brackets">Back to better.php list</a>
  34. <? if ($All) { ?>
  35. <a href="better.php?method=screenshots" class="brackets">Show only those you have snatched</a>
  36. <? } else { ?>
  37. <a href="better.php?method=screenshots&amp;filter=all" class="brackets">Show all</a>
  38. <? } ?>
  39. </div>
  40. </div>
  41. <div class="thin box pad">
  42. <h3>There are <?=number_format($NumResults)?> groups remaining</h3>
  43. <table class="torrent_table">
  44. <?
  45. foreach ($Results as $Result) {
  46. extract($Result);
  47. $LangName = $Name ? $Name : ($NameRJ ? $NameRJ : $NameJP);
  48. $TorrentTags = new Tags($TagList);
  49. $DisplayName = "<a href=\"torrents.php?id=$ID\" class=\"tooltip\" title=\"View torrent group\" ";
  50. if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
  51. $DisplayName .= 'onmouseover="getCover(event)" cover="'.ImageTools::process($WikiImage, true).'" onmouseleave="ungetCover(event)" ';
  52. }
  53. $DisplayName .= "dir=\"ltr\">$LangName</a>";
  54. if ($Year > 0) {
  55. $DisplayName .= " [$Year]";
  56. }
  57. ?>
  58. <tr class="torrent">
  59. <td><div class="<?=Format::css_category($CategoryID)?>"></div></td>
  60. <td><?=$DisplayName?><div class="tags"><?=$TorrentTags->format()?></div></td>
  61. </tr>
  62. <?
  63. } ?>
  64. </table>
  65. </div>
  66. <?
  67. View::show_footer();
  68. ?>