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.

snatchlist.php 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?
  2. $UserID = $LoggedUser['ID'];
  3. $DB->query("
  4. SELECT
  5. g.ID,
  6. g.Name,
  7. g.WikiImage,
  8. g.CategoryID,
  9. f.active,
  10. t.UserID,
  11. s.TorrentID,
  12. s.LastUpdate,
  13. s.SeedTime,
  14. s.Uploaded
  15. FROM users_seedtime as s
  16. JOIN torrents AS t ON s.TorrentID = t.ID
  17. JOIN torrents_group AS g ON g.ID = t.GroupID
  18. LEFT JOIN xbt_files_users AS f ON s.TorrentID = f.fid AND s.UserID = f.uid
  19. WHERE s.UserID = $UserID");
  20. if ($DB->has_results()) {
  21. $Torrents = $DB->to_array(false, MYSQLI_ASSOC, false);
  22. }
  23. //Include the header
  24. View::show_header('Snatch List');
  25. ?>
  26. <div class="thin">
  27. <h2 id="general">Snatch History</h2>
  28. <div class="box">
  29. <table class="torrent_table">
  30. <tbody>
  31. <tr class="colhead_dark">
  32. <td width="1%"></td>
  33. <td>Torrent</td>
  34. <td class="number_column">Time Seeded</td>
  35. <td class="number_column">Last Active</td>
  36. <td class="number_column">HnR</td>
  37. </tr>
  38. <?
  39. foreach ($Torrents as $Torrent) {
  40. $DisplayName = "<a href=\"torrents.php?id=$Torrent[ID]&torrentid=$Torrent[TorrentID]\" ";
  41. if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
  42. $DisplayName .= 'data-cover="'.ImageTools::process($Torrent['WikiImage'], 'thumb').'" ';
  43. }
  44. $DisplayName .= "dir=\"ltr\">$Torrent[Name]</a>";
  45. $HnR = false;
  46. if ($Torrent['SeedTime'] < (2*24*60*60) &&
  47. $Torrent['active'] != "1" &&
  48. $Torrent['UserID'] != $UserID
  49. ) $HnR = true;
  50. ?>
  51. <tr class="torrent">
  52. <td><div class="<?=Format::css_category($Torrent['CategoryID'])?>"></div></td>
  53. <td><a><?=$DisplayName ?></a></td>
  54. <td class="number_column"><?=time_diff(time()+$Torrent['SeedTime'], 2, false) ?></td>
  55. <td class="number_column"><?=$Torrent['LastUpdate'] ?></td>
  56. <td class="number_column"><?=($HnR?'<a class="hnr-yes">Yes</a>':'<a class="hnr-no">No</a>') ?></td>
  57. </tr>
  58. <?
  59. }
  60. ?>
  61. </tbody>
  62. </table>
  63. </div>
  64. </div>
  65. <? View::show_footer(); ?>