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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. $DB->query("SELECT UserID FROM torrents WHERE GroupID = ? AND Anonymous='1'", $GroupID);
  29. $AnonUsers = $DB->collect("UserID");
  30. $Log = $DB->query("
  31. SELECT TorrentID, UserID, Info, Time
  32. FROM group_log
  33. WHERE GroupID = ?
  34. ORDER BY Time DESC", $GroupID);
  35. $LogEntries = $DB->to_array(false, MYSQLI_NUM);
  36. foreach ($LogEntries AS $LogEntry) {
  37. list($TorrentID, $UserID, $Info, $Time) = $LogEntry;
  38. ?>
  39. <tr class="row">
  40. <td><?=$Time?></td>
  41. <?
  42. if ($TorrentID != 0) {
  43. $DB->query("
  44. SELECT Container, AudioFormat, Media
  45. FROM torrents
  46. WHERE ID = $TorrentID");
  47. list($Container, $AudioFormat, $Media) = $DB->next_record();
  48. if (!$DB->has_results()) { ?>
  49. <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a> (Deleted)</td><?
  50. } elseif ($Media == '') { ?>
  51. <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a></td><?
  52. } else { ?>
  53. <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a> (<?=$Container?>/<?=$AudioFormat?>/<?=$Media?>)</td>
  54. <? }
  55. } else { ?>
  56. <td></td>
  57. <? } ?>
  58. <td><?=in_array($UserID, $AnonUsers)?'Anonymous':Users::format_username($UserID, false, false, false)?></td>
  59. <td><?=$Info?></td>
  60. </tr>
  61. <?
  62. }
  63. ?>
  64. </table>
  65. </div>
  66. </div>
  67. <?
  68. View::show_footer();
  69. ?>