Browse Source

Consider group edits anonymous if user has uploaded a member torrent anonymously

spaghetti 7 years ago
parent
commit
b18ee05bb8
1 changed files with 7 additions and 17 deletions
  1. 7
    17
      sections/torrents/grouplog.php

+ 7
- 17
sections/torrents/grouplog.php View File

@@ -28,31 +28,21 @@ if (!empty($Groups[$GroupID])) {
28 28
       <td>Info</td>
29 29
     </tr>
30 30
 <?
31
-  $AnonTorrents = [];
31
+  $DB->query("SELECT UserID FROM torrents WHERE GroupID = ? AND Anonymous='1'", $GroupID);
32
+  $AnonUsers = $DB->collect("UserID");
32 33
   $Log = $DB->query("
33 34
       SELECT TorrentID, UserID, Info, Time
34 35
       FROM group_log
35
-      WHERE GroupID = $GroupID
36
-      ORDER BY Time DESC");
36
+      WHERE GroupID = ?
37
+      ORDER BY Time DESC", $GroupID);
37 38
   $LogEntries = $DB->to_array(false, MYSQLI_NUM);
38 39
   foreach ($LogEntries AS $LogEntry) {
39 40
     list($TorrentID, $UserID, $Info, $Time) = $LogEntry;
40
-    if (!isset($AnonTorrents[$TorrentID])) {
41
-      $DB->query("SELECT UserID, Anonymous FROM torrents WHERE ID=$TorrentID");
42
-      list($AnonUser, $IsAnon) = $DB->next_record();
43
-      $AnonTorrents[$TorrentID] = $IsAnon ? $AnonUser : -1;
44
-    }
45 41
 ?>
46 42
     <tr class="row">
47 43
       <td><?=$Time?></td>
48 44
 <?
49 45
       if ($TorrentID != 0) {
50
-      /*
51
-        $DB->query("
52
-          SELECT Media, Format, Encoding
53
-          FROM torrents
54
-          WHERE ID = $TorrentID");
55
-      */
56 46
         $DB->query("
57 47
           SELECT Container, AudioFormat, Media
58 48
           FROM torrents
@@ -64,11 +54,11 @@ if (!empty($Groups[$GroupID])) {
64 54
           <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a></td><?
65 55
         } else { ?>
66 56
           <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a> (<?=$Container?>/<?=$AudioFormat?>/<?=$Media?>)</td>
67
-<?        }
57
+<?      }
68 58
       } else { ?>
69 59
         <td></td>
70
-<?      } ?>
71
-      <td><?=($UserID == $AnonTorrents[$TorrentID])?'Anonymous':Users::format_username($UserID, false, false, false)?></td>
60
+<?    } ?>
61
+      <td><?=in_array($UserID, $AnonUsers)?'Anonymous':Users::format_username($UserID, false, false, false)?></td>
72 62
       <td><?=$Info?></td>
73 63
     </tr>
74 64
 <?

Loading…
Cancel
Save