findById((int)$_GET['id']); if (is_null($User)) { header("Location: log.php?search=User+" . (int)$_GET['id']); exit; } $UserID = $User->id(); $Username = $User->username(); $userBonus = new Gazelle\User\Bonus($User); $viewerBonus = new Gazelle\User\Bonus($Viewer); $PRL = new Gazelle\User\PermissionRateLimit($User); $donorMan = new Gazelle\Manager\Donation; $tgMan = (new Gazelle\Manager\TGroup)->setViewer($Viewer); if (!empty($_POST)) { authorize(); foreach (['action', 'flsubmit', 'fltype'] as $arg) { if (!isset($_POST[$arg])) { error(403); } } if ($_POST['action'] !== 'fltoken' || $_POST['flsubmit'] !== 'Send') { error(403); } if (!preg_match('/^fl-(other-[1-4])$/', $_POST['fltype'], $match)) { error(403); } $FL_OTHER_tokens = $viewerBonus->purchaseTokenOther($UserID, $match[1], $_POST['message'] ?? ''); if (!$FL_OTHER_tokens) { error('Purchase of tokens not concluded. Either you lacked funds or they have chosen to decline FL tokens.'); } } if ($UserID == $Viewer->id()) { $OwnProfile = true; $User->forceCacheFlush(true); $Preview = (int)($_GET['preview'] ?? 0); if ($Preview == 1) { $OwnProfile = false; } $FL_Items = []; } else { $OwnProfile = false; //Don't allow any kind of previewing on others' profiles $Preview = 0; $FL_Items = $viewerBonus->getListOther($Viewer->bonusPointsTotal()); } $FA_Key = null; // Image proxy CTs $imgProxy = new Gazelle\Util\ImageProxy($Viewer); $DisplayCustomTitle = ($Viewer->permitted('site_proxy_images') && !empty($User->title())) ? preg_replace_callback('/src=("?)(http.+?)(["\s>])/', fn ($m) => 'src=' . $m[1] . $imgProxy->process($m[2]) . $m[3], $User->title()) : $User->title(); $Paranoia = ($Preview == 1) ? explode(',', $_GET['paranoia']) : $User->paranoia(); function check_paranoia_here($Setting) { global $Paranoia, $Class, $UserID, $Preview; if ($Preview == 1) { return check_paranoia($Setting, $Paranoia ?? [], $Class); } else { return check_paranoia($Setting, $Paranoia ?? [], $Class, $UserID); } } [$ClassRatio, $Buffer] = $User->buffer(); View::show_header($Username, ['js' => 'jquery.imagesloaded,jquery.wookmark,user,bbcode,requests,lastfm,comments,info_paster', 'css' => 'tiles']); echo $Twig->render('user/header.twig', [ 'badge_list' => (new Gazelle\User\Privilege($User))->badgeList(), 'freeleech' => [ 'item' => $FL_Items, 'other' => $FL_OTHER_tokens ?? null, ], 'hourly_rate' => $userBonus->hourlyRate(), 'preview_user' => $Preview ? $userMan->findById(PARANOIA_PREVIEW_USER) : $Viewer, 'user' => $User, 'userMan' => $userMan, 'viewer' => $Viewer, ]); if ($OwnProfile || $Viewer->permitted('users_mod')) { $nextClass = $User->nextClass(); if ($nextClass) { ?>
Next Class
userInfo($User); if ($lastfmInfo) { echo $Twig->render('user/lastfm.twig', [ 'can_reload' => ($OwnProfile && $Cache->get_value("lastfm_clear_cache_$UserID") === false) || $Viewer->permitted('users_mod'), 'info' => $lastfmInfo, 'own_profile' => $OwnProfile, ]); } $vote = new Vote($User); $stats = $User->stats(); $Uploads = check_paranoia_here('uploads+') ? $stats->uploadTotal() : 0; $ArtistsAdded = check_paranoia_here('artistsadded') ? $stats->artistAddedTotal() : 0; $collageAdditions = check_paranoia_here('collagecontribs+') ? $stats->collageTotal() : 0; $releaseVotes = $vote->userTotal(Vote::UPVOTE|Vote::DOWNVOTE); $bonusPointsSpent = $userBonus->pointsSpent(); $torrentComments = check_paranoia_here('torrentcomments++') ? $stats->commentTotal('torrents') : 0; $rank = new Gazelle\UserRank( new Gazelle\UserRank\Configuration(RANKING_WEIGHT), [ 'uploaded' => $User->uploadedSize(), 'downloaded' => $User->downloadedSize(), 'uploads' => $Uploads, 'requests' => $stats->requestBountyTotal(), 'posts' => $stats->forumPostTotal(), 'bounty' => $stats->requestVoteSize(), 'artists' => $ArtistsAdded, 'collage' => $collageAdditions, 'votes' => $releaseVotes, 'bonus' => $bonusPointsSpent, 'comment-t' => $torrentComments, ] ); function display_rank(Gazelle\UserRank $r, string $dimension) { return $r->rank($dimension) === false ? 'Server busy' : $r->rank($dimension); } ?>
Percentile Rankings (hover for values)
permitted('users_mod') || $Viewer->permitted('users_view_ips') || $Viewer->permitted('users_view_keys')) { ?>
History
Personal
render('user/tag-snatch.twig', [ 'id' => $UserID, 'list' => $User->tagSnatchCounts(), ]); } echo $Twig->render('user/sidebar-stats.twig', [ 'prl' => $PRL, 'upload_total' => $Uploads, 'user' => $User, 'viewer' => $Viewer, 'visible' => [ 'collages+' => check_paranoia_here('collages+'), 'collages' => check_paranoia_here('collages'), 'collagescontrib+' => check_paranoia_here('collagecontribs+'), 'collagecontribs' => check_paranoia_here('collagecontribs'), 'downloaded' => check_paranoia_here('downloaded'), 'invitedcount' => check_paranoia_here('invitedcount'), 'leeching+' => check_paranoia_here('leeching+'), 'leeching' => check_paranoia_here('leeching'), 'perfectflacs+' => check_paranoia_here('perfectflacs+'), 'perfectflacs' => check_paranoia_here('perfectflacs'), 'seeding+' => check_paranoia_here('seeding+'), 'seeding' => check_paranoia_here('seeding'), 'snatched+' => check_paranoia_here('snatched+'), 'snatched' => check_paranoia_here('snatched'), 'torrentcomments+' => check_paranoia_here('torrentcomments+'), 'torrentcomments' => check_paranoia_here('torrentcomments'), 'requestsfilled_list' => check_paranoia_here('requestsfilled_list'), 'requestsfilled_count' => check_paranoia_here('requestsfilled_count'), 'requestsfilled_bounty' => check_paranoia_here('requestsfilled_bounty'), 'requestsvoted_list' => check_paranoia_here('requestsvoted_list'), 'requestsvoted_count' => check_paranoia_here('requestsvoted_count'), 'requestsvoted_bounty' => check_paranoia_here('requestsvoted_bounty'), 'uniquegroups+' => check_paranoia_here('uniquegroups+'), 'uniquegroups' => check_paranoia_here('uniquegroups'), 'uploads+' => check_paranoia_here('uploads+'), 'uploads' => check_paranoia_here('uploads'), ], ]); if ($Viewer->permitted("users_mod") || $OwnProfile || $User->donorVisible()) { echo $Twig->render('donation/stats.twig', [ 'is_self' => $OwnProfile, 'is_mod' => $Viewer->permitted('users_mod'), 'leaderboard' => $donorMan->leaderboardRank($User), 'user' => $User, ]); } ?>
permitted('users_mod') && $User->onRatioWatch()) { ?>
Ratio watch
This user is currently on ratio watch and must upload downloadedSize() * $User->requiredRatio()) - $User->uploadedSize())?> in the next ratioWatchExpiry()) ?>, or their leeching privileges will be revoked. Amount downloaded while on ratio watch: downloadedSize() - $User->downloadedOnRatioWatch())?>
infoTitle()) ?> Hide 
infoProfile() ? Text::full_format($User->infoProfile()) : 'This profile is currently empty.' ?>
enabledDonorRewards(); $ProfileRewards = $User->profileDonorRewards(); for ($i = 1; $i <= 4; $i++) { if ($EnabledRewards['HasProfileInfo' . $i] && $ProfileRewards['ProfileInfo' . $i]) { ?>
render('user/recent.twig', [ 'id' => $UserID, 'recent' => array_map(fn ($id) => $tgMan->findById($id), $User->recentSnatchList()), 'title' => 'Snatches', 'type' => 'snatched', ]); } if (check_paranoia_here('uploads')) { echo $Twig->render('user/recent.twig', [ 'id' => $UserID, 'recent' => array_map(fn ($id) => $tgMan->findById($id), $User->recentUploadList()), 'title' => 'Uploads', 'type' => 'uploaded', ]); } if ($OwnProfile || !$User->hasAttr('hide-vote-recent') || $Viewer->permitted('view-release-votes')) { echo $Twig->render('user/recent-vote.twig', [ 'recent' => $vote->recent($tgMan), 'show_link' => $OwnProfile || !$User->hasAttr('hide-vote-history') || $Viewer->permitted('view-release-votes'), 'user_id' => $UserID, ]); } $FirstCol = true; $Collages = (new Gazelle\Manager\Collage)->findPersonalByUserId($UserID); foreach ($Collages as $collage) { ?> groupIds(), 0, 5); foreach ($list as $tgroupId) { $tgroup = $tgMan->findById($tgroupId); ?>
name())?> - See full
permitted('users_edit_usernames')) { [$linkGroupId, $comments, $list] = (new Gazelle\Manager\UserLink($User))->info(); echo $Twig->render('user/linked.twig', [ 'auth' => $Viewer->auth(), 'comments' => $comments, 'group_id' => $linkGroupId, 'hash' => sha1($comments ?? ''), 'list' => $list, 'user_id' => $UserID, ]); } if ($Viewer->permitted('users_view_invites')) { $tree = new Gazelle\User\InviteTree($User); if ($tree->hasInvitees()) { ?>
Invite Tree View
permitted('users_give_donor')) { echo $Twig->render('donation/history.twig', [ 'history' => $User->donorHistory(), ]); } // Requests if (!$Viewer->disableRequests() && check_paranoia_here('requestsvoted_list')) { $requestList = (new Gazelle\Manager\Request)->findUnfilledByUser($User, 100); $hide = count($requestList) > 5; if ($requestList) { ?>
Requests Toggle
Request Name Vote Bounty Added
smartLink() ?>
"" . display_str($tag) . '', $request->tagNameList() )) ?>
userVotedTotal() ?> permitted('site_vote')) { ?>    + bountyTotal()) ?> created()) ?>
permitted('users_mod') || $Viewer->isStaffPMReader()) { echo $Twig->render('admin/staffpm-list.twig', [ 'list' => (new Gazelle\Staff($User))->userStaffPmList($Viewer->id()), ]); } // Displays a table of forum warnings viewable only to Forum Moderators if ($User->isStaff() && $Viewer->permitted('users_warn')) { $ForumWarnings = $User->forumWarning(); if ($ForumWarnings) { ?>
Forum warnings
permitted('users_mod') || $Viewer->isStaff()) { ?>
Staff Notes Edit Toggle
Toggle edit
permitted('users_edit_usernames')) { echo $Twig->render('user/edit-username.twig', [ 'username' => $Username, ]); } if ($Viewer->permitted('users_edit_titles')) { echo $Twig->render('user/edit-title.twig', [ 'title' => $User->title(), ]); } if ($Viewer->permitted('users_promote_below') || $Viewer->permitted('users_promote_to', $Viewer->classLevel() - 1)) { ?> permitted('users_promote_below') || $Viewer->permitted('users_promote_to')) { echo $Twig->render('user/edit-secondary-class.twig', [ 'permission' => $User->secondaryClassesList(), ]); } if ($Viewer->permitted('users_make_invisible')) { echo $Twig->render('user/edit-peer-visibility.twig', [ 'is_visible' => $User->isVisible(), ]); } if ($Viewer->permitted('admin_rate_limit_manage')) { echo $Twig->render('user/edit-rate-limit.twig', [ 'prl' => $PRL, 'user' => $User, ]); } if ($Viewer->permitted('users_edit_ratio') || ($Viewer->permitted('users_edit_own_ratio') && $OwnProfile)) { echo $Twig->render('user/edit-buffer.twig', [ 'user' => $User, ]); } if ($Viewer->permitted('users_edit_invites')) { echo $Twig->render('user/edit-invite.twig', [ 'amount' => $User->unusedInviteTotal(), ]); } if ($Viewer->permitted('admin_manage_user_fls')) { echo $Twig->render('user/edit-fltoken.twig', [ 'amount' => $User->tokenCount(), ]); } if ($Viewer->permitted('admin_manage_fls') || ($Viewer->permitted('users_mod') && $OwnProfile)) { echo $Twig->render('user/edit-remark.twig', [ 'remark' => $User->supportFor(), ]); } if ($Viewer->permitted('users_edit_reset_keys')) { echo $Twig->render('user/edit-reset.twig'); } if ($Viewer->permitted('users_edit_password')) { echo $Twig->render('user/edit-password.twig', [ 'user' => $User, ]); } ?>
User Information
Primary class:
permitted('users_disable_posts') || $Viewer->permitted('users_disable_any')) { $fm = new Gazelle\Manager\Forum; echo $Twig->render('user/edit-privileges.twig', [ 'asn' => new Gazelle\Search\ASN, 'history' => new Gazelle\User\History($User), 'user' => $User, 'viewer' => $Viewer, 'forum' => [ 'restricted_names' => implode(', ', array_map(function ($id) use ($fm) { $f = $fm->findById($id); $f ? $f->name() : $id; }, $User->forbiddenForums())), 'permitted_names' => implode(', ', array_map(function ($id) use ($fm) { $f = $fm->findById($id); $f ? $f->name() : $id; }, $User->permittedForums())), ], ]); } if ($User->isInterviewer() || $User->isRecruiter() || $User->isStaff()) { echo $Twig->render('user/edit-invite-sources.twig', [ 'list' => (new \Gazelle\Manager\InviteSource)->inviterConfiguration($User->id()), ]); } if ($Viewer->permitted('users_give_donor')) { echo $Twig->render('donation/admin-panel.twig', [ 'user' => $User, ]); } if ($Viewer->permitted('users_warn')) { echo $Twig->render('user/edit-warn.twig', [ 'user' => $User, ]); } if ($Viewer->permitted('users_disable_any')) { echo $Twig->render('user/edit-lock.twig', [ 'user' => $User, 'viewer' => $Viewer, ]); } echo $Twig->render('user/edit-submit.twig'); ?>
permitted('users_mod') */ ?>