<div class="head"> Invite Tree <a href="#" onclick="$('#invitetree').gtoggle(); return false;" class="brackets">View</a> </div> <div id="invitetree" class="hidden"> <?php $Tree->make_tree(); ?> </div> </div> <?php } if (check_perms('users_mod')) { DonationsView::render_donation_history(Donations::get_donation_history($UserID)); } // Requests if (empty($LoggedUser['DisableRequests']) && check_paranoia_here('requestsvoted_list')) { $SphQL = new SphinxqlQuery(); $SphQLResult = $SphQL->select('id, votes, bounty')->from('requests, requests_delta')->where('userid', $UserID)->where('torrentid', 0)->order_by('votes', 'desc')->order_by('bounty', 'desc')->limit(0, 100, 100)->query(); if ($SphQLResult->has_results()) { $SphRequests = $SphQLResult->to_array('id', MYSQLI_ASSOC); ?> <div class="box" id="requests_box"> <div class="head"> Requests <a href="#" onclick="$('#requests').gtoggle(); return false;" class="brackets">View</a> </div> <div id="requests" class="request_table hidden"> <table cellpadding="6" cellspacing="1" border="0" class="border" width="100%"> <tr class="colhead_dark"> <td style="width: 48%;"> <strong>Request Name</strong> </td>
$Limit = 15; } $Results = array(); if (check_paranoia_here('snatched')) { $DB->query("\n\t\tSELECT\n\t\t\tg.ID,\n\t\t\tg.Name,\n\t\t\tg.WikiImage\n\t\tFROM xbt_snatched AS s\n\t\t\tINNER JOIN torrents AS t ON t.ID = s.fid\n\t\t\tINNER JOIN torrents_group AS g ON t.GroupID = g.ID\n\t\tWHERE s.uid = '{$UserID}'\n\t\t\tAND g.CategoryID = '1'\n\t\t\tAND g.WikiImage != ''\n\t\tGROUP BY g.ID\n\t\tORDER BY s.tstamp DESC\n\t\tLIMIT {$Limit}"); $RecentSnatches = $DB->to_array(false, MYSQLI_ASSOC); $Artists = Artists::get_artists($DB->collect('ID')); foreach ($RecentSnatches as $Key => $SnatchInfo) { $RecentSnatches[$Key]['artists'][] = $Artists[$SnatchInfo['ID']]; $RecentSnatches[$Key]['ID'] = (int) $RecentSnatches[$Key]['ID']; } $Results['snatches'] = $RecentSnatches; } else { $Results['snatches'] = "hidden"; } if (check_paranoia_here('uploads')) { $DB->query("\n\t\tSELECT\n\t\t\tg.ID,\n\t\t\tg.Name,\n\t\t\tg.WikiImage\n\t\tFROM torrents_group AS g\n\t\t\tINNER JOIN torrents AS t ON t.GroupID = g.ID\n\t\tWHERE t.UserID = '{$UserID}'\n\t\t\tAND g.CategoryID = '1'\n\t\t\tAND g.WikiImage != ''\n\t\tGROUP BY g.ID\n\t\tORDER BY t.Time DESC\n\t\tLIMIT {$Limit}"); $RecentUploads = $DB->to_array(false, MYSQLI_ASSOC); $Artists = Artists::get_artists($DB->collect('ID')); foreach ($RecentUploads as $Key => $UploadInfo) { $RecentUploads[$Key]['artists'][] = $Artists[$UploadInfo['ID']]; $RecentUploads[$Key]['ID'] = (int) $RecentUploads[$Key]['ID']; } $Results['uploads'] = $RecentUploads; } else { $Results['uploads'] = "hidden"; } json_die("success", $Results); function check_paranoia_here($Setting) { global $Paranoia, $Class, $UserID, $Preview;
echo display_str($RS['Artist']); echo display_str($RS['Name']); ?> " width="107" /></a> </td> <?php } ?> </tr> </table> <?php } if (!isset($Uploads)) { $Uploads = 0; } if ($Uploads > 4 && check_paranoia_here('uploads')) { $RecentUploads = $Cache->get_value('recent_uploads_' . $UserID); if (!is_array($RecentUploads)) { $DB->query("SELECT \n\t\tg.ID,\n\t\tg.Name,\n\t\tg.WikiImage\n\t\tFROM torrents_group AS g\n\t\tINNER JOIN torrents AS t ON t.GroupID=g.ID\n\t\tWHERE t.UserID='{$UserID}'\n\t\tAND g.WikiImage <> ''\n\t\tGROUP BY g.ID\n\t\tORDER BY t.Time DESC\n\t\tLIMIT 5"); $RecentUploads = $DB->to_array(); $Artists = get_artists($DB->collect('ID')); foreach ($RecentUploads as $Key => $UploadInfo) { $RecentUploads[$Key]['Artist'] = display_artists($Artists[$UploadInfo['ID']], false, true); } $Cache->cache_value('recent_uploads_' . $UserID, $RecentUploads, 0); //inf cache } ?> <table class="recent" cellpadding="0" cellspacing="0" border="0"> <tr class="colhead"> <td colspan="5">Recent Uploads</td>
list($Invited) = $DB->next_record(); } if (!$OwnProfile) { unset($torrent_pass); } // Run through some paranoia stuff to decide what we can send out. if (!check_paranoia_here('lastseen')) { unset($LastAccess); } if (!check_paranoia_here('uploaded')) { unset($Uploaded); } if (!check_paranoia_here('downloaded')) { unset($Downloaded); } if (isset($RequiredRatio) && !check_paranoia_here('requiredratio')) { unset($RequiredRatio); } if ($ParanoiaLevel == 0) { $ParanoiaLevelText = 'Off'; } elseif ($ParanoiaLevel == 1) { $ParanoiaLevelText = 'Very Low'; } elseif ($ParanoiaLevel <= 5) { $ParanoiaLevelText = 'Low'; } elseif ($ParanoiaLevel <= 20) { $ParanoiaLevelText = 'High'; } else { $ParanoiaLevelText = 'Very high'; } header('Content-Type: text/plain; charset=utf-8'); print json_encode(array('status' => 'success', 'response' => array('username' => $Username, 'avatar' => $Avatar, 'isFriend' => $Friend, 'stats' => array('joinedDate' => $JoinDate, 'lastAccess' => $LastAccess, 'uploaded' => $Uploaded, 'downloaded' => $Downloaded, 'ratio' => $Ratio, 'requiredRatio' => $RequiredRatio), 'ranks' => array('uploaded' => $UploadedRank, 'downloaded' => $DownloadedRank, 'uploads' => $UploadsRank, 'requests' => $RequestRank, 'bounty' => $BountyRank, 'posts' => $PostRank, 'artists' => $ArtistsRank, 'overall' => $OverallRank), 'personal' => array('class' => $ClassLevels[$Class]['Name'], 'paranoia' => $ParanoiaLevel, 'paranoiaText' => $ParanoiaLevelText, 'donor' => $Donor, 'warned' => $Warned != '0000-00-00 00:00:00', 'enabled' => $Enabled == '1' || $Enabled == '0' || !$Enabled, 'passkey' => $torrent_pass), 'community' => array('posts' => $ForumPosts, 'torrentComments' => $NumComments, 'collagesStarted' => $NumCollages, 'collagesContrib' => $NumCollageContribs, 'requestsFilled' => $RequestsFilled, 'requestsVoted' => $RequestsVoted, 'uploaded' => $Uploads, 'groups' => $UniqueGroups, 'seeding' => $Seeding, 'leeching' => $Leeching, 'snatched' => $Snatched, 'invited' => $Invited))));
return check_paranoia($Setting, $User['Paranoia'], $User['Class'], $User['ID']); } if (check_paranoia_here('seeding+') || check_paranoia_here('leeching+')) { $DB->query("\n\t\tSELECT IF(remaining = 0, 'Seeding', 'Leeching') AS Type, COUNT(x.uid)\n\t\tFROM xbt_files_users AS x\n\t\t\tINNER JOIN torrents AS t ON t.ID = x.fid\n\t\tWHERE x.uid = '{$UserID}'\n\t\t\tAND x.active = 1\n\t\tGROUP BY Type"); $PeerCount = $DB->to_array(0, MYSQLI_NUM, false); if (check_paranoia('seeding+')) { $Seeding = isset($PeerCount['Seeding']) ? $PeerCount['Seeding'][1] : 0; $CommStats['seeding'] = number_format($Seeding); } if (check_paranoia('leeching+')) { $CommStats['leeching'] = isset($PeerCount['Leeching']) ? number_format($PeerCount['Leeching'][1]) : 0; } } if (check_paranoia_here('snatched+')) { $DB->query("\n\t\tSELECT COUNT(x.uid), COUNT(DISTINCT x.fid)\n\t\tFROM xbt_snatched AS x\n\t\t\tINNER JOIN torrents AS t ON t.ID = x.fid\n\t\tWHERE x.uid = '{$UserID}'"); list($Snatched, $UniqueSnatched) = $DB->next_record(MYSQLI_NUM, false); $CommStats['snatched'] = number_format($Snatched); if (check_perms('site_view_torrent_snatchlist', $User['Class'])) { $CommStats['usnatched'] = number_format($UniqueSnatched); } if (check_paranoia_here('seeding+') && check_paranoia_here('snatched+') && $UniqueSnatched > 0) { $CommStats['seedingperc'] = 100 * min(1, round($Seeding / $UniqueSnatched, 2)); } } if (check_perms('site_view_torrent_snatchlist', $Class)) { $DB->query("\n\t\tSELECT COUNT(ud.UserID), COUNT(DISTINCT ud.TorrentID)\n\t\tFROM users_downloads AS ud\n\t\t\tJOIN torrents AS t ON t.ID = ud.TorrentID\n\t\tWHERE ud.UserID = '{$UserID}'"); list($NumDownloads, $UniqueDownloads) = $DB->next_record(MYSQLI_NUM, false); $CommStats['downloaded'] = number_format($NumDownloads); $CommStats['udownloaded'] = number_format($UniqueDownloads); } json_die('success', $CommStats);
if (check_perms('site_view_torrent_snatchlist', $Class)) { ?> <li id="comm_downloaded">Downloaded: <span class="user_commstats" id="user_commstats_downloaded"><a href="#" class="brackets" onclick="commStats(<?php echo $UserID; ?> ); return false;">Show stats</a></span> <span id="user_commstats_udownloaded"></span> <a href="torrents.php?type=downloaded&userid=<?php echo $UserID; ?> " class="brackets">View</a> </li> <?php } if ($Override = check_paranoia_here('invitedcount')) { $DB->query("\n\t\tSELECT COUNT(UserID)\n\t\tFROM users_info\n\t\tWHERE Inviter = '{$UserID}'"); list($Invited) = $DB->next_record(); ?> <li id="comm_invited">Invited: <?php echo number_format($Invited); ?> </li> <?php } ?> </ul> <?php if ($LoggedUser['AutoloadCommStats']) { ?> <script type="text/javascript">