BioTorrents.de’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.

grouplog.php 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?
  2. #declare(strict_types = 1);
  3. $GroupID = $_GET['groupid'];
  4. if (!is_number($GroupID)) {
  5. error(404);
  6. }
  7. View::show_header("History for Group $GroupID");
  8. $Groups = Torrents::get_groups([$GroupID], true, true, false);
  9. if (!empty($Groups[$GroupID])) {
  10. $Group = $Groups[$GroupID];
  11. $Title = Artists::display_artists($Group['ExtendedArtists']).'<a href="torrents.php?id='.$GroupID.'">'.($Group['Name'] ? $Group['Name'] : ($Group['Title2'] ? $Group['Title2']: $Group['NameJP'])).'</a>';
  12. } else {
  13. $Title = "Group $GroupID";
  14. }
  15. ?>
  16. <div>
  17. <div class="header">
  18. <h2>History for <?=$Title?></h2>
  19. </div>
  20. <div class="box">
  21. <table>
  22. <tr class="colhead">
  23. <td style="min-width:95px;">Date</td>
  24. <td>Torrent</td>
  25. <td>User</td>
  26. <td>Info</td>
  27. </tr>
  28. <?
  29. $DB->query("SELECT UserID FROM torrents WHERE GroupID = ? AND Anonymous='1'", $GroupID);
  30. $AnonUsers = $DB->collect("UserID");
  31. $Log = $DB->query("
  32. SELECT TorrentID, UserID, Info, Time
  33. FROM group_log
  34. WHERE GroupID = ?
  35. ORDER BY Time DESC", $GroupID);
  36. $LogEntries = $DB->to_array(false, MYSQLI_NUM);
  37. foreach ($LogEntries AS $LogEntry) {
  38. list($TorrentID, $UserID, $Info, $Time) = $LogEntry;
  39. ?>
  40. <tr class="row">
  41. <td><?=$Time?></td>
  42. <?
  43. if ($TorrentID != 0) {
  44. $DB->query("
  45. SELECT Container, Version, Media
  46. FROM torrents
  47. WHERE ID = $TorrentID");
  48. list($Container, $Version, $Media) = $DB->next_record();
  49. if (!$DB->has_results()) { ?>
  50. <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a> (Deleted)</td><?
  51. } elseif ($Media == '') { ?>
  52. <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a></td><?
  53. } else { ?>
  54. <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a> (<?=$Container?>/<?=$Version?>/<?=$Media?>)</td>
  55. <?php }
  56. } else { ?>
  57. <td></td>
  58. <?php } ?>
  59. <td><?=in_array($UserID, $AnonUsers)?'Anonymous':Users::format_username($UserID, false, false, false)?></td>
  60. <td><?=$Info?></td>
  61. </tr>
  62. <?
  63. }
  64. ?>
  65. </table>
  66. </div>
  67. </div>
  68. <?
  69. View::show_footer();
  70. ?>