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