purchaseTokenOther($LoggedUser['ID'], $UserID, $match[1]);
}
catch (Exception $e) {
if ($e->getMessage() == 'Bonus:otherToken:no-gift-funds') {
error('Purchase of tokens not concluded. Either you lacked funds or they have chosen to decline FL tokens.');
} else {
error(0);
}
}
}
$Preview = isset($_GET['preview']) ? $_GET['preview'] : 0;
if ($UserID == $LoggedUser['ID']) {
$OwnProfile = true;
if ($Preview == 1) {
$OwnProfile = false;
$ParanoiaString = $_GET['paranoia'];
$CustomParanoia = explode(',', $ParanoiaString);
}
$FL_Items = [];
} else {
$OwnProfile = false;
//Don't allow any kind of previewing on others' profiles
$Preview = 0;
$FL_Items = $Bonus->getListOther($LoggedUser['BonusPoints']);
}
$FA_Key = null;
if (check_perms('users_mod')) {
// Person viewing is staff
$DB->prepared_query('
SELECT
um.Username, um.Email, ula.last_access, um.IP, p.Level AS Class, uls.Uploaded, uls.Downloaded,
coalesce(ub.points, 0) as BonusPoints, um.RequiredRatio, um.Title, um.torrent_pass, um.Enabled, um.Paranoia,
um.Invites, um.can_leech, um.Visible, i.JoinDate, i.Info, i.Avatar, i.AdminComment, i.Donor,
i.Artist, i.Warned, i.SupportFor, i.RestrictedForums, i.PermittedForums, i.Inviter,
inviter.Username, COUNT(posts.id) AS ForumPosts, i.RatioWatchEnds, i.RatioWatchDownload, i.DisableAvatar,
i.DisableInvites, i.DisablePosting, i.DisablePoints, i.DisableForums, i.DisableTagging,
i.DisableUpload, i.DisableWiki, i.DisablePM, i.DisableIRC, i.DisableRequests, uf.tokens AS FLTokens,
um.2FA_Key, SHA1(i.AdminComment), i.InfoTitle, la.Type AS LockedAccount, i.collages,
CASE WHEN uhafl.UserID IS NULL THEN 1 ELSE 0 END AS AcceptFL,
CASE WHEN uhaud.UserID IS NULL THEN 0 ELSE 1 END AS UnlimitedDownload
FROM users_main AS um
LEFT JOIN user_last_access AS ula ON (ula.user_id = um.ID)
INNER JOIN users_leech_stats AS uls ON (uls.UserID = um.ID)
INNER JOIN users_info AS i ON (i.UserID = um.ID)
INNER JOIN user_flt AS uf ON (uf.user_id = um.ID)
LEFT JOIN user_bonus AS ub ON (ub.user_id = um.ID)
LEFT JOIN users_main AS inviter ON (i.Inviter = inviter.ID)
LEFT JOIN permissions AS p ON (p.ID = um.PermissionID)
LEFT JOIN forums_posts AS posts ON (posts.AuthorID = um.ID)
LEFT JOIN locked_accounts AS la ON (la.UserID = um.ID)
LEFT JOIN user_has_attr AS uhafl ON (uhafl.UserID = um.ID AND uhafl.UserAttrID = (SELECT ID FROM user_attr WHERE Name = ?))
LEFT JOIN user_has_attr AS uhaud ON (uhaud.UserID = um.ID AND uhaud.UserAttrID = (SELECT ID FROM user_attr WHERE Name = ?))
WHERE um.ID = ?
GROUP BY AuthorID
', 'no-fl-gifts', 'unlimited-download', $UserID
);
list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded,
$BonusPoints, $RequiredRatio, $CustomTitle, $torrent_pass, $Enabled, $Paranoia,
$Invites, $DisableLeech, $Visible, $JoinDate, $Info, $Avatar, $AdminComment, $Donor,
$Artist, $Warned, $SupportFor, $RestrictedForums, $PermittedForums, $InviterID,
$InviterName, $ForumPosts, $RatioWatchEnds, $RatioWatchDownload, $DisableAvatar,
$DisableInvites, $DisablePosting, $DisablePoints, $DisableForums, $DisableTagging,
$DisableUpload, $DisableWiki, $DisablePM, $DisableIRC, $DisableRequests, $FLTokens,
$FA_Key, $CommentHash, $InfoTitle, $LockedAccount, $MaxCollages,
$AcceptFL, $UnlimitedDownload)
= $DB->next_record(MYSQLI_NUM, [9, 12]);
} else {
// Person viewing is a normal user
$DB->prepared_query('
SELECT
um.Username, um.Email, ula.last_access, um.IP, p.Level AS Class, uls.Uploaded, uls.Downloaded,
coalesce(ub.points, 0) as BonusPoints, um.RequiredRatio, um.Enabled, um.Paranoia, um.Invites, um.Title,
um.torrent_pass, um.can_leech, i.JoinDate, i.Info, i.Avatar, uf.tokens AS FLTokens, i.Donor, i.Warned,
COUNT(posts.id) AS ForumPosts, i.Inviter, i.DisableInvites, inviter.username, i.InfoTitle,
CASE WHEN uhafl.UserID IS NULL THEN 1 ELSE 0 END AS AcceptFL
FROM users_main AS um
LEFT JOIN user_last_access AS ula ON (ula.user_id = um.ID)
INNER JOIN users_leech_stats AS uls ON (uls.UserID = um.ID)
INNER JOIN users_info AS i ON (i.UserID = um.ID)
INNER JOIN user_flt AS uf ON (uf.user_id = um.ID)
LEFT JOIN user_bonus AS ub ON (ub.user_id = um.ID)
LEFT JOIN permissions AS p ON (p.ID = um.PermissionID)
LEFT JOIN users_main AS inviter ON (i.Inviter = inviter.ID)
LEFT JOIN forums_posts AS posts ON (posts.AuthorID = um.ID)
LEFT JOIN user_has_attr AS uhafl ON (uhafl.UserID = um.ID AND uhafl.UserAttrID = (SELECT ID FROM user_attr WHERE Name = ?))
WHERE um.ID = ?
GROUP BY AuthorID
', 'no-fl-gifts', $UserID
);
list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded,
$BonusPoints, $RequiredRatio, $Enabled, $Paranoia, $Invites, $CustomTitle,
$torrent_pass, $DisableLeech, $JoinDate, $Info, $Avatar, $FLTokens, $Donor, $Warned,
$ForumPosts, $InviterID, $DisableInvites, $InviterName, $InfoTitle,
$AcceptFL)
= $DB->next_record(MYSQLI_NUM, [10, 12]);
$UnlimitedDownload = null;
}
if (!$Username) { // If user doesn't exist
header("Location: log.php?search=User+$UserID");
}
if ($Warned == '') {
$Warned = null; // Fuck Gazelle
}
$BonusPointsPerHour = $Bonus->userHourlyRate($UserID);
// Image proxy CTs
$DisplayCustomTitle = $CustomTitle;
if (check_perms('site_proxy_images') && !empty($CustomTitle)) {
$DisplayCustomTitle = preg_replace_callback('~src=("?)(http.+?)(["\s>])~',
function($Matches) {
return 'src=' . $Matches[1] . ImageTools::process($Matches[2]) . $Matches[3];
}, $CustomTitle);
}
if ($Preview == 1) {
if (strlen($ParanoiaString) == 0) {
$Paranoia = [];
} else {
$Paranoia = $CustomParanoia;
}
} else {
$Paranoia = unserialize($Paranoia);
if (!is_array($Paranoia)) {
$Paranoia = [];
}
}
$ParanoiaLevel = 0;
foreach ($Paranoia as $P) {
$ParanoiaLevel++;
if (strpos($P, '+') !== false) {
$ParanoiaLevel++;
}
}
$JoinedDate = time_diff($JoinDate);
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);
}
}
View::show_header($Username, "jquery.imagesloaded,jquery.wookmark,user,bbcode,requests,lastfm,comments,info_paster", "tiles");
$User = new Gazelle\User($UserID);
$User->forceCacheFlush($OwnProfile);
list($ClassRatio, $Buffer) = $User->buffer();
?>
$Uploaded) {
?>
Ratio watch
This user is currently on ratio watch and must upload =Format::get_size(($Downloaded * $RequiredRatio) - $Uploaded)?> in the next =time_diff($RatioWatchEnds)?>, or their leeching privileges will be revoked. Amount downloaded while on ratio watch: =Format::get_size($Downloaded - $RatioWatchDownload)?>
=!empty($InfoTitle) ? $InfoTitle : 'Profile';?>
Hide
This profile is currently empty.
enabledRewards($UserID);
$ProfileRewards = $donorMan->profileRewards($UserID);
for ($i = 1; $i <= 4; $i++) {
if ($EnabledRewards['HasProfileInfo' . $i] && $ProfileRewards['ProfileInfo' . $i]) {
?>
=!empty($ProfileRewards['ProfileInfoTitle' . $i]) ? display_str($ProfileRewards['ProfileInfoTitle' . $i]) : "Extra Profile " . ($i + 1)?>
Hide
= Text::full_format($ProfileRewards['ProfileInfo' . $i]); ?>
render('user/recent.twig', [
'id' => $UserID,
'recent' => $User->recentSnatches(),
'title' => 'Snatches',
'type' => 'snatched',
]);
}
if (check_paranoia_here('uploads')) {
echo G::$Twig->render('user/recent.twig', [
'id' => $UserID,
'recent' => $User->recentUploads(),
'title' => 'Uploads',
'type' => 'uploaded',
]);
}
$Collages = $User->personalCollages();
$FirstCol = true;
foreach ($Collages as $CollageInfo) {
list($CollageID, $CName) = $CollageInfo;
$DB->prepared_query('
SELECT ct.GroupID,
tg.WikiImage,
tg.CategoryID
FROM collages_torrents AS ct
INNER JOIN torrents_group AS tg ON (tg.ID = ct.GroupID)
WHERE ct.CollageID = ?
ORDER BY ct.Sort
LIMIT 5
', $CollageID
);
$Collage = $DB->to_array(false, MYSQLI_ASSOC, false);
?>
0) {
require(__DIR__ . '/../../classes/invite_tree.class.php');
$Tree = new INVITE_TREE($UserID, ['visible' => false]);
?>
render('donation/history.twig', [
'history' => $donorMan->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) // Limit to 100 requests
->query();
if ($SphQLResult->has_results()) {
$SphRequests = $SphQLResult->to_array('id', MYSQLI_ASSOC);
?>
|
Request Name
|
Vote
|
Bounty
|
Added
|
$SphRequest) {
$Request = $Requests[$RequestID];
$VotesCount = $SphRequest['votes'];
$Bounty = $SphRequest['bounty'] * 1024; // Sphinx stores bounty in kB
$CategoryName = $Categories[$Request['CategoryID'] - 1];
if ($CategoryName == 'Music') {
$ArtistForm = Requests::get_artists($RequestID);
$ArtistLink = Artists::display_artists($ArtistForm, true, true);
$FullName = "$ArtistLink$Request[Title] [$Request[Year]]";
} elseif ($CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
$FullName = "$Request[Title] [$Request[Year]]";
} else {
$FullName = "$Request[Title]";
}
?>
|
=$FullName ?>
|
=$VotesCount?>
+
|
=Format::get_size($Bounty)?>
|
=time_diff($Request['TimeAdded']) ?>
|
prepared_query('
SELECT
SQL_CALC_FOUND_ROWS
spc.ID,
spc.Subject,
spc.Status,
spc.Level,
spc.AssignedToUser,
spc.Date,
COUNT(spm.ID) AS Resplies,
spc.ResolverID
FROM staff_pm_conversations AS spc
JOIN staff_pm_messages spm ON spm.ConvID = spc.ID
WHERE spc.UserID = ?
AND (spc.Level <= ? OR spc.AssignedToUser = ?)
GROUP BY spc.ID
ORDER BY spc.Date DESC
', $UserID, $UserLevel, $LoggedUser['ID']
);
if ($DB->has_results()) {
$StaffPMs = $DB->to_array();
?>
| Subject |
Date |
Assigned to |
Replies |
Resolved by |
| =display_str($Subject)?> |
=time_diff($Date, 2, true)?> |
=$Assigned?> |
=$Replies - 1?> |
=$Resolver?> |
forumWarning();
if ($ForumWarnings) {
?>