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.

grouplog.php 2.4KB

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