Browse Source

Add total seeding size to profiles

spaghetti 8 years ago
parent
commit
c2439219b6
1 changed files with 18 additions and 0 deletions
  1. 18
    0
      sections/user/user.php

+ 18
- 0
sections/user/user.php View File

@@ -135,6 +135,19 @@ $ForumPosts, $InviterID, $DisableInvites, $InviterName, $InfoTitle) = $DB->next_
135 135
 }
136 136
 $Email = apc_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
137 137
 
138
+$DB->query("
139
+  SELECT SUM(t.Size)
140
+  FROM xbt_files_users AS xfu
141
+  JOIN torrents AS t on t.ID = xfu.fid
142
+  WHERE
143
+    xfu.uid = '$UserID'
144
+    AND xfu.active = 1
145
+    AND xfu.Remaining = 0");
146
+ if ($DB->has_results()) {
147
+  list($TotalSeeding) = $DB->next_record(MYSQLI_NUM, false);
148
+ }
149
+
150
+
138 151
 // Image proxy CTs
139 152
 $DisplayCustomTitle = $CustomTitle;
140 153
 if (check_perms('site_proxy_images') && !empty($CustomTitle)) {
@@ -347,6 +360,11 @@ if ($LoggedUser['Class'] >= 200 || $DB->has_results()) { ?>
347 360
   if (($Override = check_paranoia_here('requiredratio')) && isset($RequiredRatio)) {
348 361
 ?>
349 362
         <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Required Ratio: <span class="tooltip" title="<?=number_format((double)$RequiredRatio, 5)?>"><?=number_format((double)$RequiredRatio, 2)?></span></li>
363
+<?
364
+  }
365
+  if (($Override = check_paranoia_here('downloaded'))) {
366
+?>
367
+      <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Total Seeding: <span class="tooltip" title="<?=Format::get_size($TotalSeeding)?>"><?=Format::get_size($TotalSeeding)?></li>
350 368
 <?
351 369
   }
352 370
   if ($OwnProfile || ($Override = check_paranoia_here(false)) || check_perms('users_mod')) {

Loading…
Cancel
Save