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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?
  2. $UserID = $LoggedUser['ID'];
  3. $DB->query("
  4. SELECT g.ID,g.Name,g.WikiImage,g.CategoryID,x.fid,f.mtime,f.active,f.uploaded,f.downloaded,t.UserID,x.seedtime
  5. FROM xbt_snatched as x
  6. JOIN torrents AS t ON x.fid = t.ID
  7. JOIN torrents_group AS g ON g.ID = t.GroupID
  8. LEFT JOIN xbt_files_users AS f ON x.fid = f.fid AND x.uid = f.uid
  9. WHERE x.uid = $UserID");
  10. if ($DB->has_results()) {
  11. $Torrents = $DB->to_array(false, MYSQLI_ASSOC, false);
  12. }
  13. //Include the header
  14. View::show_header('Snatch List');
  15. ?>
  16. <div class="thin">
  17. <h2 id="general">Snatch History</h2>
  18. <div class="box">
  19. <table class="torrent_table">
  20. <tbody>
  21. <tr class="colhead_dark">
  22. <td width="1%"></td>
  23. <td>Torrent</td>
  24. <td class="number_column">Last Active</td>
  25. <td class="number_column">HnR</td>
  26. </tr>
  27. <?
  28. foreach ($Torrents as $Torrent) {
  29. $DisplayName = "<a href=\"torrents.php?id=$Torrent[ID]&torrentid=$Torrent[fid]\" ";
  30. if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
  31. $DisplayName .= 'onmouseover="getCover(event)" cover="'.ImageTools::process($Torrent['WikiImage'], true).'" onmouseleave="ungetCover(event)" ';
  32. }
  33. $DisplayName .= "dir=\"ltr\">$Torrent[Name]</a>";
  34. $HnR = false;
  35. if ($Torrent['seedtime'] < 48 &&
  36. $Torrent['active'] != "1" &&
  37. $Torrent['UserID'] != $UserID &&
  38. $Torrent['uploaded'] < $Torrent['downloaded']
  39. ) $HnR = true;
  40. ?>
  41. <tr class="torrent">
  42. <td><div class="<?=Format::css_category($Torrent['CategoryID'])?>"></div></td>
  43. <td><a><?=$DisplayName ?></a></td>
  44. <td class="number_column"><?=($Torrent['mtime']?date('Y-m-d H:i:s',$Torrent['mtime']):'Never') ?></td>
  45. <td class="number_column"><?=($HnR?'<a class="hnr-yes">Yes</a>':'<a class="hnr-no">No</a>') ?></td>
  46. </tr>
  47. <?
  48. }
  49. ?>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. <? View::show_footer(); ?>