query("SELECT m.Username, m.Email, m.LastAccess, m.IP, p.Level AS Class, m.Uploaded, m.Downloaded, m.RequiredRatio, m.Title, m.torrent_pass, m.Enabled, m.Paranoia, m.Invites, m.can_leech, m.Visible, i.JoinDate, i.Info, i.Avatar, i.Country, 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.DisableForums, i.DisableTagging, i.DisableUpload, i.DisableWiki, i.DisablePM, i.DisableIRC, i.DisableRequests, i.HideCountryChanges, m.FLTokens, SHA1(i.AdminComment) FROM users_main AS m JOIN users_info AS i ON i.UserID = m.ID LEFT JOIN users_main AS inviter ON i.Inviter = inviter.ID LEFT JOIN permissions AS p ON p.ID=m.PermissionID LEFT JOIN forums_posts AS posts ON posts.AuthorID = m.ID WHERE m.ID = '".$UserID."' GROUP BY AuthorID"); if ($DB->record_count() == 0) { // If user doesn't exist header("Location: log.php?search=User+".$UserID); } list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $CustomTitle, $torrent_pass, $Enabled, $Paranoia, $Invites, $DisableLeech, $Visible, $JoinDate, $Info, $Avatar, $Country, $AdminComment, $Donor, $Artist, $Warned, $SupportFor, $RestrictedForums, $PermittedForums, $InviterID, $InviterName, $ForumPosts, $RatioWatchEnds, $RatioWatchDownload, $DisableAvatar, $DisableInvites, $DisablePosting, $DisableForums, $DisableTagging, $DisableUpload, $DisableWiki, $DisablePM, $DisableIRC, $DisableRequests, $DisableCountry, $FLTokens, $CommentHash) = $DB->next_record(MYSQLI_NUM, array(8,11)); } else { // Person viewing is a normal user $DB->query("SELECT m.Username, m.Email, m.LastAccess, m.IP, p.Level AS Class, m.Uploaded, m.Downloaded, m.RequiredRatio, m.Enabled, m.Paranoia, m.Invites, m.Title, m.torrent_pass, m.can_leech, i.JoinDate, i.Info, i.Avatar, m.FLTokens, i.Country, i.Donor, i.Warned, COUNT(posts.id) AS ForumPosts, i.Inviter, i.DisableInvites, inviter.username FROM users_main AS m JOIN users_info AS i ON i.UserID = m.ID LEFT JOIN permissions AS p ON p.ID=m.PermissionID LEFT JOIN users_main AS inviter ON i.Inviter = inviter.ID LEFT JOIN forums_posts AS posts ON posts.AuthorID = m.ID WHERE m.ID = $UserID GROUP BY AuthorID"); if ($DB->record_count() == 0) { // If user doesn't exist header("Location: log.php?search=User+".$UserID); } list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $Enabled, $Paranoia, $Invites, $CustomTitle, $torrent_pass, $DisableLeech, $JoinDate, $Info, $Avatar, $FLTokens, $Country, $Donor, $Warned, $ForumPosts, $InviterID, $DisableInvites, $InviterName, $RatioWatchEnds, $RatioWatchDownload) = $DB->next_record(MYSQLI_NUM, array(9,11)); } // 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].'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Matches[2]).$Matches[3]; }, $CustomTitle); } $Paranoia = unserialize($Paranoia); if(!is_array($Paranoia)) { $Paranoia = array(); } $ParanoiaLevel = 0; foreach($Paranoia as $P) { $ParanoiaLevel++; if(strpos($P, '+')) { $ParanoiaLevel++; } } $JoinedDate = time_diff($JoinDate); $LastAccess = time_diff($LastAccess); function check_paranoia_here($Setting) { global $Paranoia, $Class, $UserID; return check_paranoia($Setting, $Paranoia, $Class, $UserID); } $Badges=($Donor) ? 'Donor' : ''; $Badges.=($Warned!='0000-00-00 00:00:00') ? 'Warned' : ''; $Badges.=($Enabled == '1' || $Enabled == '0' || !$Enabled) ? '': 'Banned'; show_header($Username,'user,bbcode,requests'); ?>