2011-03-28 14:21:28 +00:00
< ?
2013-05-27 08:00:58 +00:00
include ( SERVER_ROOT . '/classes/text.class.php' ); // Text formatting class
2011-03-28 14:21:28 +00:00
$Text = new TEXT ;
2013-05-16 16:15:57 +00:00
if ( empty ( $_GET [ 'id' ]) || ! is_numeric ( $_GET [ 'id' ]) || ( ! empty ( $_GET [ 'preview' ]) && ! is_numeric ( $_GET [ 'preview' ]))) {
error ( 404 );
}
2011-03-28 14:21:28 +00:00
$UserID = $_GET [ 'id' ];
2013-09-11 08:00:55 +00:00
$Preview = isset ( $_GET [ 'preview' ]) ? $_GET [ 'preview' ] : 0 ;
2013-04-13 08:00:19 +00:00
if ( $UserID == $LoggedUser [ 'ID' ]) {
2011-03-28 14:21:28 +00:00
$OwnProfile = true ;
2013-05-16 16:15:57 +00:00
if ( $Preview == 1 ) {
$OwnProfile = false ;
$ParanoiaString = $_GET [ 'paranoia' ];
$CustomParanoia = explode ( ',' , $ParanoiaString );
}
2012-10-11 08:00:15 +00:00
} else {
2011-03-28 14:21:28 +00:00
$OwnProfile = false ;
2013-05-16 16:15:57 +00:00
//Don't allow any kind of previewing on others' profiles
$Preview = 0 ;
2011-03-28 14:21:28 +00:00
}
2013-08-28 23:08:41 +00:00
$EnabledRewards = Donations :: get_enabled_rewards ( $UserID );
$Rewards = Donations :: get_rewards ( $UserID );
$ProfileRewards = Donations :: get_profile_rewards ( $UserID );
$AvatarMouseOverText = '' ;
$SecondAvatar = '' ;
if ( $EnabledRewards [ 'HasAvatarMouseOverText' ] && ! empty ( $Rewards [ 'AvatarMouseOverText' ])) {
$AvatarMouseOverText = " title= \" $Rewards[AvatarMouseOverText] \" alt= \" $Rewards[AvatarMouseOverText] \" " ;
}
if ( $EnabledRewards [ 'HasSecondAvatar' ] && ! empty ( $Rewards [ 'SecondAvatar' ])) {
$SecondAvatar = 'data-gazelle-second-avatar="' . ImageTools :: process ( $Rewards [ 'SecondAvatar' ]) . '"' ;
}
2011-03-28 14:21:28 +00:00
2012-06-02 08:00:16 +00:00
2013-04-13 08:00:19 +00:00
if ( check_perms ( 'users_mod' )) { // Person viewing is a staff member
2013-05-16 16:15:57 +00:00
$DB -> 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 . 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 ,
2013-08-28 23:08:41 +00:00
i . DisableRequests , " . "
2013-05-16 16:15:57 +00:00
m . FLTokens ,
2013-08-28 23:08:41 +00:00
SHA1 ( i . AdminComment ),
i . InfoTitle
2011-03-28 14:21:28 +00:00
FROM users_main AS m
2013-04-17 08:00:58 +00:00
JOIN users_info AS i ON i . UserID = m . ID
LEFT JOIN users_main AS inviter ON i . Inviter = inviter . ID
2013-08-28 23:08:41 +00:00
LEFT JOIN permissions AS p ON p . ID = m . PermissionID
2013-04-17 08:00:58 +00:00
LEFT JOIN forums_posts AS posts ON posts . AuthorID = m . ID
2013-05-16 16:15:57 +00:00
WHERE m . ID = '$UserID'
GROUP BY AuthorID " );
2011-03-28 14:21:28 +00:00
2013-07-10 00:08:53 +00:00
if ( ! $DB -> has_results ()) { // If user doesn't exist
2013-08-28 23:08:41 +00:00
header ( " Location: log.php?search=User+ $UserID " );
2011-03-28 14:21:28 +00:00
}
2013-08-28 23:08:41 +00:00
list ( $Username , $Email , $LastAccess , $IP , $Class , $Uploaded , $Downloaded , $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 , $DisableForums , $DisableTagging , $DisableUpload , $DisableWiki , $DisablePM , $DisableIRC , $DisableRequests , $FLTokens , $CommentHash , $InfoTitle ) = $DB -> next_record ( MYSQLI_NUM , array ( 8 , 11 ));
2011-03-28 14:21:28 +00:00
} else { // Person viewing is a normal user
2013-05-16 16:15:57 +00:00
$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 . Donor ,
i . Warned ,
COUNT ( posts . id ) AS ForumPosts ,
i . Inviter ,
i . DisableInvites ,
2013-08-28 23:08:41 +00:00
inviter . username ,
i . InfoTitle
2011-03-28 14:21:28 +00:00
FROM users_main AS m
2013-04-17 08:00:58 +00:00
JOIN users_info AS i ON i . UserID = m . ID
2013-08-28 23:08:41 +00:00
LEFT JOIN permissions AS p ON p . ID = m . PermissionID
2013-04-17 08:00:58 +00:00
LEFT JOIN users_main AS inviter ON i . Inviter = inviter . ID
LEFT JOIN forums_posts AS posts ON posts . AuthorID = m . ID
2013-05-16 16:15:57 +00:00
WHERE m . ID = $UserID
GROUP BY AuthorID " );
2011-03-28 14:21:28 +00:00
2013-07-10 00:08:53 +00:00
if ( ! $DB -> has_results ()) { // If user doesn't exist
2013-08-28 23:08:41 +00:00
header ( " Location: log.php?search=User+ $UserID " );
2011-03-28 14:21:28 +00:00
}
2013-08-28 23:08:41 +00:00
list ( $Username , $Email , $LastAccess , $IP , $Class , $Uploaded , $Downloaded ,
$RequiredRatio , $Enabled , $Paranoia , $Invites , $CustomTitle , $torrent_pass ,
$DisableLeech , $JoinDate , $Info , $Avatar , $FLTokens , $Donor , $Warned ,
$ForumPosts , $InviterID , $DisableInvites , $InviterName , $InfoTitle ) = $DB -> next_record ( MYSQLI_NUM , array ( 9 , 11 ));
2011-03-28 14:21:28 +00:00
}
2011-09-22 08:00:12 +00:00
// Image proxy CTs
$DisplayCustomTitle = $CustomTitle ;
2013-04-13 08:00:19 +00:00
if ( check_perms ( 'site_proxy_images' ) && ! empty ( $CustomTitle )) {
2013-05-16 16:15:57 +00:00
$DisplayCustomTitle = preg_replace_callback ( '~src=("?)(http.+?)(["\s>])~' ,
function ( $Matches ) {
return 'src=' . $Matches [ 1 ] . ImageTools :: process ( $Matches [ 2 ]) . $Matches [ 3 ];
}, $CustomTitle );
2011-09-22 08:00:12 +00:00
}
2013-05-16 16:15:57 +00:00
if ( $Preview == 1 ) {
if ( strlen ( $ParanoiaString ) == 0 ) {
$Paranoia = array ();
} else {
2013-05-30 08:00:30 +00:00
$Paranoia = $CustomParanoia ;
2013-05-16 16:15:57 +00:00
}
} else {
$Paranoia = unserialize ( $Paranoia );
if ( ! is_array ( $Paranoia )) {
$Paranoia = array ();
}
2011-03-28 14:21:28 +00:00
}
$ParanoiaLevel = 0 ;
2013-04-13 08:00:19 +00:00
foreach ( $Paranoia as $P ) {
2011-03-28 14:21:28 +00:00
$ParanoiaLevel ++ ;
2013-06-24 08:00:28 +00:00
if ( strpos ( $P , '+' ) !== false ) {
2011-03-28 14:21:28 +00:00
$ParanoiaLevel ++ ;
}
}
$JoinedDate = time_diff ( $JoinDate );
$LastAccess = time_diff ( $LastAccess );
function check_paranoia_here ( $Setting ) {
2013-05-16 16:15:57 +00:00
global $Paranoia , $Class , $UserID , $Preview ;
if ( $Preview == 1 ) {
return check_paranoia ( $Setting , $Paranoia , $Class );
} else {
return check_paranoia ( $Setting , $Paranoia , $Class , $UserID );
}
2011-03-28 14:21:28 +00:00
}
2013-09-09 08:00:52 +00:00
View :: show_header ( $Username , " jquery.imagesloaded,jquery.wookmark,user,bbcode,requests,lastfm,comments,info_paster " , " tiles " );
2013-01-01 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
?>
< div class = " thin " >
2013-08-28 23:08:41 +00:00
< h2 >< ? = Users :: format_username ( $UserID , true , true , true , false , true ) ?> </h2>
2011-03-28 14:21:28 +00:00
< div class = " linkbox " >
2013-08-28 23:08:41 +00:00
< ?
if ( ! $OwnProfile ) { ?>
2013-02-18 08:00:22 +00:00
< a href = " inbox.php?action=compose&to=<?= $UserID ?> " class = " brackets " > Send message </ a >
2013-05-28 08:01:02 +00:00
< ?
2013-06-09 08:01:21 +00:00
$DB -> query ( "
SELECT FriendID
FROM friends
2013-06-24 08:00:28 +00:00
WHERE UserID = '$LoggedUser[ID]'
AND FriendID = '$UserID' " );
2013-07-10 00:08:53 +00:00
if ( ! $DB -> has_results ()) { ?>
2013-01-26 08:00:19 +00:00
< a href = " friends.php?action=add&friendid=<?= $UserID ?>&auth=<?= $LoggedUser['AuthKey'] ?> " class = " brackets " > Add to friends </ a >
2013-05-15 08:00:54 +00:00
< ? } ?>
2013-02-18 08:00:22 +00:00
< a href = " reports.php?action=report&type=user&id=<?= $UserID ?> " class = " brackets " > Report user </ a >
2011-03-28 14:21:28 +00:00
< ?
}
2013-08-28 23:08:41 +00:00
if ( check_perms ( 'users_edit_profiles' , $Class ) || $LoggedUser [ 'ID' ] == $UserID ) {
2011-03-28 14:21:28 +00:00
?>
2013-01-26 08:00:19 +00:00
< a href = " user.php?action=edit&userid=<?= $UserID ?> " class = " brackets " > Settings </ a >
2013-08-28 23:08:41 +00:00
< ?
}
2011-03-28 14:21:28 +00:00
if ( check_perms ( 'users_view_invites' , $Class )) {
?>
2013-01-26 08:00:19 +00:00
< a href = " user.php?action=invite&userid=<?= $UserID ?> " class = " brackets " > Invites </ a >
2011-03-28 14:21:28 +00:00
< ? }
if ( check_perms ( 'admin_manage_permissions' , $Class )) {
?>
2013-01-26 08:00:19 +00:00
< a href = " user.php?action=permissions&userid=<?= $UserID ?> " class = " brackets " > Permissions </ a >
2011-03-28 14:21:28 +00:00
< ? }
if ( check_perms ( 'users_logout' , $Class ) && check_perms ( 'users_view_ips' , $Class )) {
?>
2013-01-26 08:00:19 +00:00
< a href = " user.php?action=sessions&userid=<?= $UserID ?> " class = " brackets " > Sessions </ a >
2011-03-28 14:21:28 +00:00
< ? }
if ( check_perms ( 'admin_reports' )) {
?>
2013-01-26 08:00:19 +00:00
< a href = " reportsv2.php?view=reporter&id=<?= $UserID ?> " class = " brackets " > Reports </ a >
2011-03-28 14:21:28 +00:00
< ? }
2011-10-08 08:00:14 +00:00
if ( check_perms ( 'users_mod' )) {
2011-03-28 14:21:28 +00:00
?>
2013-02-16 08:00:57 +00:00
< a href = " userhistory.php?action=token_history&userid=<?= $UserID ?> " class = " brackets " > FL tokens </ a >
2012-10-11 08:00:15 +00:00
< ? }
2012-05-03 08:00:25 +00:00
if ( check_perms ( 'admin_clear_cache' ) && check_perms ( 'users_override_paranoia' )) {
2012-03-29 08:00:19 +00:00
?>
2013-02-16 08:00:57 +00:00
< a href = " user.php?action=clearcache&id=<?= $UserID ?> " class = " brackets " > Clear cache </ a >
2011-10-08 08:00:14 +00:00
< ? } ?>
2011-03-28 14:21:28 +00:00
</ div >
< div class = " sidebar " >
2012-12-09 08:00:20 +00:00
< ?
if ( $Avatar && Users :: has_avatars_enabled ()) {
2013-05-02 08:00:23 +00:00
// TODO: use Users::show_avatar; why is display_str() used a few lines below (where avatar is displayed)?
2013-04-13 08:00:19 +00:00
if ( check_perms ( 'site_proxy_images' ) && ! empty ( $Avatar )) {
2013-06-24 08:00:28 +00:00
$Avatar = 'http' . ( $SSL ? 's' : '' ) . '://' . SITE_URL . '/image.php?c=1&avatar=' . $UserID . '&i=' . urlencode ( $Avatar );
2011-03-28 14:21:28 +00:00
}
?>
2012-08-17 08:00:13 +00:00
< div class = " box box_image box_image_avatar " >
2011-03-28 14:21:28 +00:00
< div class = " head colhead_dark " > Avatar </ div >
2013-08-28 23:08:41 +00:00
< div align = " center " >< img class = " avatar double_avatar " src = " <?=display_str( $Avatar )?> " width = " 150 " style = " max-height: 400px; " < ? = $AvatarMouseOverText ?> <?=$SecondAvatar?> /></div>
2011-03-28 14:21:28 +00:00
</ div >
< ? } ?>
2012-08-17 08:00:13 +00:00
< div class = " box box_info box_userinfo_stats " >
2013-08-28 23:08:41 +00:00
< div class = " head colhead_dark " > Statistics </ div >
2011-03-28 14:21:28 +00:00
< ul class = " stats nobullet " >
2013-08-28 23:08:41 +00:00
< li > Joined : < ? = $JoinedDate ?> </li>
2013-04-17 08:00:58 +00:00
< ? if (( $Override = check_paranoia_here ( 'lastseen' ))) { ?>
2013-08-28 23:08:41 +00:00
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> >Last seen: <?=$LastAccess?></li>
2013-04-17 08:00:58 +00:00
< ? }
2013-06-24 08:00:28 +00:00
if (( $Override = check_paranoia_here ( 'uploaded' ))) { ?>
2013-08-28 23:08:41 +00:00
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> title="<?=Format::get_size($Uploaded, 5)?>">Uploaded: <?=Format::get_size($Uploaded)?></li>
2013-04-17 08:00:58 +00:00
< ? }
2013-06-24 08:00:28 +00:00
if (( $Override = check_paranoia_here ( 'downloaded' ))) { ?>
2013-08-28 23:08:41 +00:00
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> title="<?=Format::get_size($Downloaded, 5)?>">Downloaded: <?=Format::get_size($Downloaded)?></li>
2013-04-17 08:00:58 +00:00
< ? }
2013-06-24 08:00:28 +00:00
if (( $Override = check_paranoia_here ( 'ratio' ))) { ?>
2013-08-28 23:08:41 +00:00
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> >Ratio: <?=Format::get_ratio_html($Uploaded, $Downloaded)?></li>
2013-04-17 08:00:58 +00:00
< ? }
2013-06-24 08:00:28 +00:00
if (( $Override = check_paranoia_here ( 'requiredratio' )) && isset ( $RequiredRatio )) { ?>
2013-08-28 23:08:41 +00:00
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> >Required Ratio: <?=number_format((double)$RequiredRatio, 2)?></li>
2013-04-17 08:00:58 +00:00
< ? }
2013-06-24 08:00:28 +00:00
if ( $OwnProfile || ( $Override = check_paranoia_here ( false )) || check_perms ( 'users_mod' )) { ?>
2013-08-28 23:08:41 +00:00
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> ><a href="userhistory.php?action=token_history&userid=<?=$UserID?>">Tokens</a>: <?=number_format($FLTokens)?></li>
2013-04-17 08:00:58 +00:00
< ? }
2013-06-24 08:00:28 +00:00
if (( $OwnProfile || check_perms ( 'users_mod' )) && $Warned != '0000-00-00 00:00:00' ) { ?>
2013-08-28 23:08:41 +00:00
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> >Warning expires in: <?=time_diff((date('Y-m-d H:i', strtotime($Warned))))?></li>
2013-04-17 08:00:58 +00:00
< ? } ?>
2011-03-28 14:21:28 +00:00
</ ul >
</ div >
< ?
2013-05-16 16:15:57 +00:00
// Last.fm statistics and comparability
2013-09-14 08:00:52 +00:00
$LastFMUsername = LastFM :: get_lastfm_username ( $UserID );
if ( $LastFMUsername ) {
LastFMView :: render_sidebar ( $LastFMUsername , $UserID , $OwnProfile );
}
2011-03-28 14:21:28 +00:00
if ( check_paranoia_here ( 'requestsfilled_count' ) || check_paranoia_here ( 'requestsfilled_bounty' )) {
2013-05-16 16:15:57 +00:00
$DB -> query ( "
SELECT
COUNT ( DISTINCT r . ID ),
SUM ( rv . Bounty )
FROM requests AS r
2013-06-24 08:00:28 +00:00
LEFT JOIN requests_votes AS rv ON r . ID = rv . RequestID
2013-05-16 16:15:57 +00:00
WHERE r . FillerID = $UserID " );
2011-03-28 14:21:28 +00:00
list ( $RequestsFilled , $TotalBounty ) = $DB -> next_record ();
2012-01-24 08:00:19 +00:00
} else {
$RequestsFilled = $TotalBounty = 0 ;
}
if ( check_paranoia_here ( 'requestsvoted_count' ) || check_paranoia_here ( 'requestsvoted_bounty' )) {
2013-05-16 16:15:57 +00:00
$DB -> query ( "
SELECT COUNT ( rv . RequestID ), SUM ( rv . Bounty )
FROM requests_votes AS rv
WHERE rv . UserID = $UserID " );
2011-03-28 14:21:28 +00:00
list ( $RequestsVoted , $TotalSpent ) = $DB -> next_record ();
2013-05-16 16:15:57 +00:00
$DB -> query ( "
SELECT COUNT ( r . ID ), SUM ( rv . Bounty )
FROM requests AS r
LEFT JOIN requests_votes AS rv ON rv . RequestID = r . ID AND rv . UserID = r . UserID
WHERE r . UserID = $UserID " );
2013-04-22 08:00:58 +00:00
list ( $RequestsCreated , $RequestsCreatedSpent ) = $DB -> next_record ();
2011-03-28 14:21:28 +00:00
} else {
2013-04-22 08:00:58 +00:00
$RequestsVoted = $TotalSpent = $RequestsCreated = $RequestsCreatedSpent = 0 ;
2011-03-28 14:21:28 +00:00
}
2013-04-13 08:00:19 +00:00
if ( check_paranoia_here ( 'uploads+' )) {
2013-06-09 08:01:21 +00:00
$DB -> query ( "
SELECT COUNT ( ID )
FROM torrents
WHERE UserID = '$UserID' " );
2011-03-28 14:21:28 +00:00
list ( $Uploads ) = $DB -> next_record ();
} else {
$Uploads = 0 ;
}
if ( check_paranoia_here ( 'artistsadded' )) {
2013-06-09 08:01:21 +00:00
$DB -> query ( "
SELECT COUNT ( ta . ArtistID )
FROM torrents_artists AS ta
WHERE ta . UserID = $UserID " );
2011-03-28 14:21:28 +00:00
list ( $ArtistsAdded ) = $DB -> next_record ();
} else {
$ArtistsAdded = 0 ;
}
2013-06-19 08:01:09 +00:00
//Do the ranks
$UploadedRank = UserRank :: get_rank ( 'uploaded' , $Uploaded );
$DownloadedRank = UserRank :: get_rank ( 'downloaded' , $Downloaded );
$UploadsRank = UserRank :: get_rank ( 'uploads' , $Uploads );
$RequestRank = UserRank :: get_rank ( 'requests' , $RequestsFilled );
$PostRank = UserRank :: get_rank ( 'posts' , $ForumPosts );
$BountyRank = UserRank :: get_rank ( 'bounty' , $TotalSpent );
$ArtistsRank = UserRank :: get_rank ( 'artists' , $ArtistsAdded );
2011-03-28 14:21:28 +00:00
2013-04-13 08:00:19 +00:00
if ( $Downloaded == 0 ) {
2011-03-28 14:21:28 +00:00
$Ratio = 1 ;
2013-04-13 08:00:19 +00:00
} elseif ( $Uploaded == 0 ) {
2011-03-28 14:21:28 +00:00
$Ratio = 0.5 ;
} else {
2013-05-16 16:15:57 +00:00
$Ratio = round ( $Uploaded / $Downloaded , 2 );
2011-03-28 14:21:28 +00:00
}
2013-06-19 08:01:09 +00:00
$OverallRank = UserRank :: overall_score ( $UploadedRank , $DownloadedRank , $UploadsRank , $RequestRank , $PostRank , $BountyRank , $ArtistsRank , $Ratio );
2011-03-28 14:21:28 +00:00
?>
2012-08-17 08:00:13 +00:00
< div class = " box box_info box_userinfo_percentile " >
2013-08-28 23:08:41 +00:00
< div class = " head colhead_dark " > Percentile Rankings ( hover for values ) </ div >
2011-03-28 14:21:28 +00:00
< ul class = " stats nobullet " >
2013-08-28 23:08:41 +00:00
< ? if (( $Override = check_paranoia_here ( 'uploaded' ))) { ?>
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> title="<?=Format::get_size($Uploaded)?>">Data uploaded: <?=$UploadedRank === false ? 'Server busy' : number_format($UploadedRank)?></li>
< ?
}
if (( $Override = check_paranoia_here ( 'downloaded' ))) { ?>
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> title="<?=Format::get_size($Downloaded)?>">Data downloaded: <?=$DownloadedRank === false ? 'Server busy' : number_format($DownloadedRank)?></li>
< ?
}
if (( $Override = check_paranoia_here ( 'uploads+' ))) { ?>
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> title="<?=number_format($Uploads)?>">Torrents uploaded: <?=$UploadsRank === false ? 'Server busy' : number_format($UploadsRank)?></li>
< ?
}
if (( $Override = check_paranoia_here ( 'requestsfilled_count' ))) { ?>
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> title="<?=number_format($RequestsFilled)?>">Requests filled: <?=$RequestRank === false ? 'Server busy' : number_format($RequestRank)?></li>
< ?
}
if (( $Override = check_paranoia_here ( 'requestsvoted_bounty' ))) { ?>
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> title="<?=Format::get_size($TotalSpent)?>">Bounty spent: <?=$BountyRank === false ? 'Server busy' : number_format($BountyRank)?></li>
< ? } ?>
< li title = " <?=number_format( $ForumPosts )?> " > Posts made : < ? = $PostRank === false ? 'Server busy' : number_format ( $PostRank ) ?> </li>
< ? if (( $Override = check_paranoia_here ( 'artistsadded' ))) { ?>
< li < ? = ( $Override === 2 ? ' class="paranoia_override"' : '' ) ?> title="<?=number_format($ArtistsAdded)?>">Artists added: <?=$ArtistsRank === false ? 'Server busy' : number_format($ArtistsRank)?></li>
< ?
}
if ( check_paranoia_here ( array ( 'uploaded' , 'downloaded' , 'uploads+' , 'requestsfilled_count' , 'requestsvoted_bounty' , 'artistsadded' ))) { ?>
< li >< strong > Overall rank : < ? = $OverallRank === false ? 'Server busy' : number_format ( $OverallRank ) ?> </strong></li>
< ? } ?>
2011-03-28 14:21:28 +00:00
</ ul >
</ div >
< ?
2013-06-24 08:00:28 +00:00
if ( check_perms ( 'users_mod' , $Class ) || check_perms ( 'users_view_ips' , $Class ) || check_perms ( 'users_view_keys' , $Class )) {
2013-06-09 08:01:21 +00:00
$DB -> query ( "
SELECT COUNT ( * )
FROM users_history_passwords
WHERE UserID = '$UserID' " );
2011-03-28 14:21:28 +00:00
list ( $PasswordChanges ) = $DB -> next_record ();
2013-06-24 08:00:28 +00:00
if ( check_perms ( 'users_view_keys' , $Class )) {
2013-06-09 08:01:21 +00:00
$DB -> query ( "
SELECT COUNT ( * )
FROM users_history_passkeys
WHERE UserID = '$UserID' " );
2011-03-28 14:21:28 +00:00
list ( $PasskeyChanges ) = $DB -> next_record ();
}
2013-06-24 08:00:28 +00:00
if ( check_perms ( 'users_view_ips' , $Class )) {
2013-06-09 08:01:21 +00:00
$DB -> query ( "
SELECT COUNT ( DISTINCT IP )
FROM users_history_ips
WHERE UserID = '$UserID' " );
2011-03-28 14:21:28 +00:00
list ( $IPChanges ) = $DB -> next_record ();
2013-06-09 08:01:21 +00:00
$DB -> query ( "
SELECT COUNT ( DISTINCT IP )
FROM xbt_snatched
WHERE uid = '$UserID'
AND IP != '' " );
2011-03-28 14:21:28 +00:00
list ( $TrackerIPs ) = $DB -> next_record ();
}
2013-06-24 08:00:28 +00:00
if ( check_perms ( 'users_view_email' , $Class )) {
2013-06-09 08:01:21 +00:00
$DB -> query ( "
SELECT COUNT ( * )
FROM users_history_emails
WHERE UserID = '$UserID' " );
2011-03-28 14:21:28 +00:00
list ( $EmailChanges ) = $DB -> next_record ();
}
?>
2013-10-13 08:01:01 +00:00
< div class = " box box_info box_userinfo_history " >
< div class = " head colhead_dark " > History </ div >
< ul class = " stats nobullet " >
2013-08-28 23:08:41 +00:00
< ? if ( check_perms ( 'users_view_email' , $Class )) { ?>
2013-10-13 08:01:01 +00:00
< li > Emails : < ? = number_format ( $EmailChanges ) ?> <a href="userhistory.php?action=email2&userid=<?=$UserID?>" class="brackets">View</a> <a href="userhistory.php?action=email&userid=<?=$UserID?>" class="brackets">Legacy view</a></li>
2011-03-28 14:21:28 +00:00
< ?
2013-08-28 23:08:41 +00:00
}
if ( check_perms ( 'users_view_ips' , $Class )) {
2011-03-28 14:21:28 +00:00
?>
2013-10-13 08:01:01 +00:00
< li > IPs : < ? = number_format ( $IPChanges ) ?> <a href="userhistory.php?action=ips&userid=<?=$UserID?>" class="brackets">View</a> <a href="userhistory.php?action=ips&userid=<?=$UserID?>&usersonly=1" class="brackets">View users</a></li>
2013-08-28 23:08:41 +00:00
< ? if ( check_perms ( 'users_view_ips' , $Class ) && check_perms ( 'users_mod' , $Class )) { ?>
2013-10-13 08:01:01 +00:00
< li > Tracker IPs : < ? = number_format ( $TrackerIPs ) ?> <a href="userhistory.php?action=tracker_ips&userid=<?=$UserID?>" class="brackets">View</a></li>
2011-03-28 14:21:28 +00:00
< ?
2013-08-28 23:08:41 +00:00
}
}
if ( check_perms ( 'users_view_keys' , $Class )) {
2011-03-28 14:21:28 +00:00
?>
2013-10-13 08:01:01 +00:00
< li > Passkeys : < ? = number_format ( $PasskeyChanges ) ?> <a href="userhistory.php?action=passkeys&userid=<?=$UserID?>" class="brackets">View</a></li>
2011-03-28 14:21:28 +00:00
< ?
2013-08-28 23:08:41 +00:00
}
if ( check_perms ( 'users_mod' , $Class )) {
2011-03-28 14:21:28 +00:00
?>
2013-10-13 08:01:01 +00:00
< li > Passwords : < ? = number_format ( $PasswordChanges ) ?> <a href="userhistory.php?action=passwords&userid=<?=$UserID?>" class="brackets">View</a></li>
< li > Stats : N / A < a href = " userhistory.php?action=stats&userid=<?= $UserID ?> " class = " brackets " > View </ a ></ li >
2013-10-01 23:08:42 +00:00
< ? } ?>
2013-10-13 08:01:01 +00:00
</ ul >
</ div >
2011-03-28 14:21:28 +00:00
< ? } ?>
2012-08-17 08:00:13 +00:00
< div class = " box box_info box_userinfo_personal " >
2011-03-28 14:21:28 +00:00
< div class = " head colhead_dark " > Personal </ div >
< ul class = " stats nobullet " >
2013-08-28 23:08:41 +00:00
< li > Class : < ? = $ClassLevels [ $Class ][ 'Name' ] ?> </li>
2011-03-28 14:21:28 +00:00
< ?
2012-10-11 08:00:15 +00:00
$UserInfo = Users :: user_info ( $UserID );
2012-03-28 08:00:20 +00:00
if ( ! empty ( $UserInfo [ 'ExtraClasses' ])) {
?>
< li >
< ul class = " stats " >
< ?
2013-04-13 08:00:19 +00:00
foreach ( $UserInfo [ 'ExtraClasses' ] as $PermID => $Val ) { ?>
2012-03-28 08:00:20 +00:00
< li >< ? = $Classes [ $PermID ][ 'Name' ] ?> </li>
2013-06-24 08:00:28 +00:00
< ? } ?>
2012-03-28 08:00:20 +00:00
</ ul >
</ li >
< ?
}
2011-03-28 14:21:28 +00:00
// An easy way for people to measure the paranoia of a user, for e.g. contest eligibility
2013-04-13 08:00:19 +00:00
if ( $ParanoiaLevel == 0 ) {
2011-03-28 14:21:28 +00:00
$ParanoiaLevelText = 'Off' ;
2013-04-13 08:00:19 +00:00
} elseif ( $ParanoiaLevel == 1 ) {
2011-03-28 14:21:28 +00:00
$ParanoiaLevelText = 'Very Low' ;
2013-04-13 08:00:19 +00:00
} elseif ( $ParanoiaLevel <= 5 ) {
2011-03-28 14:21:28 +00:00
$ParanoiaLevelText = 'Low' ;
2013-04-13 08:00:19 +00:00
} elseif ( $ParanoiaLevel <= 20 ) {
2011-03-28 14:21:28 +00:00
$ParanoiaLevelText = 'High' ;
} else {
$ParanoiaLevelText = 'Very high' ;
}
?>
2013-08-28 23:08:41 +00:00
< li > Paranoia level : < span title = " <?= $ParanoiaLevel ?> " >< ? = $ParanoiaLevelText ?> </span></li>
2013-05-16 16:15:57 +00:00
< ? if ( check_perms ( 'users_view_email' , $Class ) || $OwnProfile ) { ?>
2013-08-28 23:08:41 +00:00
< li > Email : < a href = " mailto:<?=display_str( $Email )?> " >< ? = display_str ( $Email ) ?> </a>
2013-06-24 08:00:28 +00:00
< ? if ( check_perms ( 'users_view_email' , $Class )) { ?>
2013-02-09 08:01:01 +00:00
< a href = " user.php?action=search&email_history=on&email=<?=display_str( $Email )?> " title = " Search " class = " brackets " > S </ a >
2011-03-28 14:21:28 +00:00
< ? } ?>
</ li >
< ? }
2013-06-24 08:00:28 +00:00
if ( check_perms ( 'users_view_ips' , $Class )) {
2011-03-28 14:21:28 +00:00
?>
2013-08-28 23:08:41 +00:00
< li > IP : < ? = Tools :: display_ip ( $IP ) ?> </li>
< li > Host : < ? = Tools :: get_host_by_ajax ( $IP ) ?> </li>
2011-03-28 14:21:28 +00:00
< ?
}
2013-06-24 08:00:28 +00:00
if ( check_perms ( 'users_view_keys' , $Class ) || $OwnProfile ) {
2011-03-28 14:21:28 +00:00
?>
2013-08-28 23:08:41 +00:00
< li > Passkey : < a href = " # " id = " passkey " onclick = " togglePassKey('<?=display_str( $torrent_pass )?>'); return false; " class = " brackets " > View </ a ></ li >
< ?
}
2011-03-28 14:21:28 +00:00
if ( check_perms ( 'users_view_invites' )) {
if ( ! $InviterID ) {
2013-06-09 08:01:21 +00:00
$Invited = '<span style="font-style: italic;">Nobody</span>' ;
2011-03-28 14:21:28 +00:00
} else {
2013-08-28 23:08:41 +00:00
$Invited = " <a href= \" user.php?id= $InviterID\ " > $InviterName </ a > " ;
2011-03-28 14:21:28 +00:00
}
2013-05-16 16:15:57 +00:00
2011-03-28 14:21:28 +00:00
?>
2013-08-28 23:08:41 +00:00
< li > Invited by : < ? = $Invited ?> </li>
< li > Invites : < ?
2013-06-09 08:01:21 +00:00
$DB -> query ( "
2013-07-10 00:08:53 +00:00
SELECT COUNT ( InviterID )
2013-06-09 08:01:21 +00:00
FROM invites
WHERE InviterID = '$UserID' " );
2011-03-28 14:21:28 +00:00
list ( $Pending ) = $DB -> next_record ();
2013-04-13 08:00:19 +00:00
if ( $DisableInvites ) {
2012-09-23 08:00:25 +00:00
echo 'X' ;
} else {
echo number_format ( $Invites );
}
2013-05-16 16:15:57 +00:00
echo " ( $Pending ) "
2011-03-28 14:21:28 +00:00
?> </li>
< ?
}
2011-10-19 08:00:13 +00:00
if ( ! isset ( $SupportFor )) {
2013-08-28 23:08:41 +00:00
$DB -> query ( '
2013-06-09 08:01:21 +00:00
SELECT SupportFor
FROM users_info
2013-08-28 23:08:41 +00:00
WHERE UserID = '.$LoggedUser[' ID ' ]);
2011-10-19 08:00:13 +00:00
list ( $SupportFor ) = $DB -> next_record ();
}
2013-05-16 16:15:57 +00:00
if ( $Override = check_perms ( 'users_mod' ) || $OwnProfile || ! empty ( $SupportFor )) {
2013-10-13 08:01:01 +00:00
?>
< li < ? = (( $Override === 2 || $SupportFor ) ? ' class="paranoia_override"' : '' ) ?> >Clients: <?
2013-06-09 08:01:21 +00:00
$DB -> query ( "
SELECT DISTINCT useragent
FROM xbt_files_users
WHERE uid = $UserID " );
2013-02-09 08:01:01 +00:00
$Clients = $DB -> collect ( 0 );
2013-05-16 16:15:57 +00:00
echo implode ( '; ' , $Clients );
2011-10-19 08:00:13 +00:00
?> </li>
< ?
}
2011-03-28 14:21:28 +00:00
?>
</ ul >
</ div >
< ?
2012-10-03 08:00:16 +00:00
include ( SERVER_ROOT . '/sections/user/community_stats.php' );
2013-08-28 23:08:41 +00:00
DonationsView :: render_donor_stats ( $UserID );
2012-11-16 08:00:21 +00:00
?>
</ div >
< div class = " main_column " >
< ?
2013-06-09 08:01:21 +00:00
if ( $RatioWatchEnds != '0000-00-00 00:00:00'
2012-11-16 08:00:21 +00:00
&& ( time () < strtotime ( $RatioWatchEnds ))
2013-06-09 08:01:21 +00:00
&& ( $Downloaded * $RequiredRatio ) > $Uploaded
2012-11-16 08:00:21 +00:00
) {
?>
< div class = " box " >
< div class = " head " > Ratio watch </ div >
2013-06-09 08:01:21 +00:00
< div class = " pad " > 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)?></div>
2012-11-16 08:00:21 +00:00
</ div >
< ? } ?>
< div class = " box " >
< div class = " head " >
2013-08-28 23:08:41 +00:00
< ? =! empty ( $InfoTitle ) ? $InfoTitle : 'Profile' ; ?>
< span style = " float: right; " >< a href = " # " onclick = " $ ('#profilediv').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false; " class = " brackets " > Hide </ a ></ span >& nbsp ;
2012-11-16 08:00:21 +00:00
</ div >
< div class = " pad " id = " profilediv " >
2013-04-17 08:00:58 +00:00
< ? if ( ! $Info ) { ?>
2012-11-16 08:00:21 +00:00
This profile is currently empty .
< ?
2013-04-17 08:00:58 +00:00
} else {
echo $Text -> full_format ( $Info );
}
2012-11-16 08:00:21 +00:00
?>
</ div >
</ div >
2013-10-13 08:01:01 +00:00
< ? DonationsView :: render_profile_rewards ( $EnabledRewards , $ProfileRewards ); ?>
2012-11-16 08:00:21 +00:00
< ?
2013-06-17 08:01:02 +00:00
if ( check_paranoia_here ( 'snatched' )) {
2013-08-28 23:08:41 +00:00
$RecentSnatches = $Cache -> get_value ( " recent_snatches_ $UserID " );
2013-06-17 08:01:02 +00:00
if ( $RecentSnatches === false ) {
2013-05-15 08:00:54 +00:00
$DB -> query ( "
SELECT
g . ID ,
g . Name ,
g . WikiImage
FROM xbt_snatched AS s
2013-06-24 08:00:28 +00:00
INNER JOIN torrents AS t ON t . ID = s . fid
INNER JOIN torrents_group AS g ON t . GroupID = g . ID
WHERE s . uid = '$UserID'
AND g . CategoryID = '1'
2013-05-27 08:00:58 +00:00
AND g . WikiImage != ''
2013-05-15 08:00:54 +00:00
GROUP BY g . ID
ORDER BY s . tstamp DESC
LIMIT 5 " );
2012-11-16 08:00:21 +00:00
$RecentSnatches = $DB -> to_array ();
$Artists = Artists :: get_artists ( $DB -> collect ( 'ID' ));
2013-04-13 08:00:19 +00:00
foreach ( $RecentSnatches as $Key => $SnatchInfo ) {
2012-11-16 08:00:21 +00:00
$RecentSnatches [ $Key ][ 'Artist' ] = Artists :: display_artists ( $Artists [ $SnatchInfo [ 'ID' ]], false , true );
}
$Cache -> cache_value ( 'recent_snatches_' . $UserID , $RecentSnatches , 0 ); //inf cache
}
2013-06-17 08:01:02 +00:00
if ( ! empty ( $RecentSnatches )) {
2012-11-16 08:00:21 +00:00
?>
< table class = " layout recent " id = " recent_snatches " cellpadding = " 0 " cellspacing = " 0 " border = " 0 " >
< tr class = " colhead " >
2013-04-30 18:18:07 +00:00
< td colspan = " 5 " >
2013-08-28 23:08:41 +00:00
< a href = " #recent_snatches " class = " brackets anchor " > #</a> Recent Snatches
2013-04-30 18:18:07 +00:00
</ td >
2012-11-16 08:00:21 +00:00
</ tr >
< tr >
2013-04-30 18:18:07 +00:00
< ? foreach ( $RecentSnatches as $RS ) { ?>
2012-11-16 08:00:21 +00:00
< td >
2013-09-29 08:00:52 +00:00
< a href = " torrents.php?id=<?= $RS['ID'] ?> " title = " <?=display_str( $RS['Artist'] )?><?=display_str( $RS['Name'] )?> " >
< img class = " tooltip " title = " <?=display_str( $RS['Artist'] )?><?=display_str( $RS['Name'] )?> " src = " <?=ImageTools::process( $RS['WikiImage'] , true)?> " alt = " <?=display_str( $RS['Artist'] )?><?=display_str( $RS['Name'] )?> " width = " 107 " />
</ a >
2012-11-16 08:00:21 +00:00
</ td >
< ? } ?>
</ tr >
</ table >
< ?
2013-06-17 08:01:02 +00:00
}
2012-11-16 08:00:21 +00:00
}
2013-06-17 08:01:02 +00:00
if ( check_paranoia_here ( 'uploads' )) {
2013-08-28 23:08:41 +00:00
$RecentUploads = $Cache -> get_value ( " recent_uploads_ $UserID " );
2013-06-17 08:01:02 +00:00
if ( $RecentUploads === false ) {
2013-05-15 08:00:54 +00:00
$DB -> query ( "
SELECT
g . ID ,
g . Name ,
g . WikiImage
FROM torrents_group AS g
2013-06-24 08:00:28 +00:00
INNER JOIN torrents AS t ON t . GroupID = g . ID
WHERE t . UserID = '$UserID'
AND g . CategoryID = '1'
2013-05-27 08:00:58 +00:00
AND g . WikiImage != ''
2013-05-15 08:00:54 +00:00
GROUP BY g . ID
ORDER BY t . Time DESC
LIMIT 5 " );
2012-11-16 08:00:21 +00:00
$RecentUploads = $DB -> to_array ();
$Artists = Artists :: get_artists ( $DB -> collect ( 'ID' ));
2013-04-13 08:00:19 +00:00
foreach ( $RecentUploads as $Key => $UploadInfo ) {
2012-11-16 08:00:21 +00:00
$RecentUploads [ $Key ][ 'Artist' ] = Artists :: display_artists ( $Artists [ $UploadInfo [ 'ID' ]], false , true );
}
2013-08-28 23:08:41 +00:00
$Cache -> cache_value ( " recent_uploads_ $UserID " , $RecentUploads , 0 ); //inf cache
2012-11-16 08:00:21 +00:00
}
2013-06-17 08:01:02 +00:00
if ( ! empty ( $RecentUploads )) {
2012-11-16 08:00:21 +00:00
?>
< table class = " layout recent " id = " recent_uploads " cellpadding = " 0 " cellspacing = " 0 " border = " 0 " >
< tr class = " colhead " >
2013-04-30 18:18:07 +00:00
< td colspan = " 5 " >
2013-08-28 23:08:41 +00:00
< a href = " #recent_uploads " class = " brackets anchor " > #</a> Recent Uploads
2013-04-30 18:18:07 +00:00
</ td >
2012-11-16 08:00:21 +00:00
</ tr >
< tr >
2013-04-30 18:18:07 +00:00
< ? foreach ( $RecentUploads as $RU ) { ?>
2012-11-16 08:00:21 +00:00
< td >
2013-09-29 08:00:52 +00:00
< a href = " torrents.php?id=<?= $RU['ID'] ?> " >
< img class = " tooltip " title = " <?= $RU['Artist'] ?><?= $RU['Name'] ?> " src = " <?=ImageTools::process( $RU['WikiImage'] , true)?> " alt = " <?= $RU['Artist'] ?><?= $RU['Name'] ?> " width = " 107 " />
</ a >
2012-11-16 08:00:21 +00:00
</ td >
< ? } ?>
</ tr >
</ table >
< ?
2013-06-17 08:01:02 +00:00
}
2012-11-16 08:00:21 +00:00
}
2013-05-15 08:00:54 +00:00
$DB -> query ( "
SELECT ID , Name
FROM collages
2013-06-24 08:00:28 +00:00
WHERE UserID = '$UserID'
AND CategoryID = '0'
AND Deleted = '0'
2013-09-13 08:00:53 +00:00
ORDER BY Featured DESC ,
Name ASC " );
$Collages = $DB -> to_array ( false , MYSQLI_NUM , false );
2012-11-16 08:00:21 +00:00
$FirstCol = true ;
foreach ( $Collages as $CollageInfo ) {
list ( $CollageID , $CName ) = $CollageInfo ;
2013-05-15 08:00:54 +00:00
$DB -> query ( "
SELECT ct . GroupID ,
tg . WikiImage ,
tg . CategoryID
2012-11-16 08:00:21 +00:00
FROM collages_torrents AS ct
2013-06-24 08:00:28 +00:00
JOIN torrents_group AS tg ON tg . ID = ct . GroupID
WHERE ct . CollageID = '$CollageID'
2013-05-15 08:00:54 +00:00
ORDER BY ct . Sort
LIMIT 5 " );
2013-09-13 08:00:53 +00:00
$Collage = $DB -> to_array ( false , MYSQLI_ASSOC , false );
2012-11-16 08:00:21 +00:00
?>
2013-04-30 18:18:07 +00:00
< table class = " layout recent " id = " collage<?= $CollageID ?>_box " cellpadding = " 0 " cellspacing = " 0 " border = " 0 " >
2012-11-16 08:00:21 +00:00
< tr class = " colhead " >
< td colspan = " 5 " >
2013-05-15 08:00:54 +00:00
< span style = " float: left; " >
2013-05-28 08:01:02 +00:00
< a href = " #collage<?= $CollageID ?>_box " class = " brackets anchor " > #</a> <?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
2012-11-16 08:00:21 +00:00
</ span >
2013-05-15 08:00:54 +00:00
< span style = " float: right; " >
2013-06-17 08:01:02 +00:00
< a href = " # " onclick = " $ ('#collage<?= $CollageID ?>_box .images').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false; " class = " brackets " >< ? = $FirstCol ? 'Hide' : 'Show' ?> </a>
2012-11-16 08:00:21 +00:00
</ span >
</ td >
</ tr >
2013-02-23 08:00:22 +00:00
< tr class = " images<?= $FirstCol ? '' : ' hidden'?> " >
2013-04-13 08:00:19 +00:00
< ? foreach ( $Collage as $C ) {
2013-09-13 08:00:53 +00:00
$Group = Torrents :: get_groups ( array ( $C [ 'GroupID' ]), true , true , false );
extract ( Torrents :: array_group ( $Group [ $C [ 'GroupID' ]]));
2012-11-16 08:00:21 +00:00
$Name = '' ;
2013-06-24 08:00:28 +00:00
$Name .= Artists :: display_artists ( array ( '1' => $Artists ), false , true );
2012-11-16 08:00:21 +00:00
$Name .= $GroupName ;
?>
< td >
2013-09-29 08:00:52 +00:00
< a href = " torrents.php?id=<?= $GroupID ?> " title = " <?= $Name ?> " >
< img class = " tooltip " title = " <?= $Name ?> " src = " <?=ImageTools::process( $C['WikiImage'] , true)?> " alt = " <?= $Name ?> " width = " 107 " />
</ a >
2012-11-16 08:00:21 +00:00
</ td >
< ? } ?>
</ tr >
</ table >
< ?
$FirstCol = false ;
}
2013-09-09 08:00:52 +00:00
2012-11-16 08:00:21 +00:00
2013-01-02 08:00:26 +00:00
2012-02-04 08:00:25 +00:00
// Linked accounts
2013-04-13 08:00:19 +00:00
if ( check_perms ( 'users_mod' )) {
2012-02-04 08:00:25 +00:00
include ( SERVER_ROOT . '/sections/user/linkedfunctions.php' );
user_dupes_table ( $UserID );
}
2011-03-28 14:21:28 +00:00
if (( check_perms ( 'users_view_invites' )) && $Invited > 0 ) {
2013-05-27 08:00:58 +00:00
include ( SERVER_ROOT . '/classes/invite_tree.class.php' );
2013-06-24 08:00:28 +00:00
$Tree = new INVITE_TREE ( $UserID , array ( 'visible' => false ));
2011-03-28 14:21:28 +00:00
?>
2013-04-30 18:18:07 +00:00
< div class = " box " id = " invitetree_box " >
< div class = " head " >
2013-08-28 23:08:41 +00:00
< a href = " #invitetree_box " class = " brackets anchor " > #</a> Invite Tree <a href="#" onclick="$('#invitetree').gtoggle(); return false;" class="brackets">View</a>
2013-04-30 18:18:07 +00:00
</ div >
2011-03-28 14:21:28 +00:00
< div id = " invitetree " class = " hidden " >
2013-10-13 08:01:01 +00:00
< ? $Tree -> make_tree (); ?>
2011-03-28 14:21:28 +00:00
</ div >
</ div >
< ?
}
2013-08-28 23:08:41 +00:00
if ( check_perms ( 'users_mod' )) {
DonationsView :: render_donation_history ( Donations :: get_donation_history ( $UserID ));
}
2011-03-28 14:21:28 +00:00
// Requests
2013-05-07 08:00:23 +00:00
if ( empty ( $LoggedUser [ 'DisableRequests' ]) && check_paranoia_here ( 'requestsvoted_list' )) {
2013-09-13 08:00:53 +00:00
$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 );
2011-03-28 14:21:28 +00:00
?>
2013-04-30 18:18:07 +00:00
< div class = " box " id = " requests_box " >
< div class = " head " >
2013-06-17 08:01:02 +00:00
< a href = " #requests_box " class = " brackets anchor " > #</a> Requests <a href="#" onclick="$('#requests').gtoggle(); return false;" class="brackets">View</a>
2013-04-30 18:18:07 +00:00
</ div >
2012-09-01 08:00:24 +00:00
< div id = " requests " class = " request_table hidden " >
2011-03-28 14:21:28 +00:00
< table cellpadding = " 6 " cellspacing = " 1 " border = " 0 " class = " border " width = " 100% " >
< tr class = " colhead_dark " >
2013-05-15 08:00:54 +00:00
< td style = " width: 48%; " >
2013-09-11 08:00:55 +00:00
< strong > Request Name </ strong >
2011-03-28 14:21:28 +00:00
</ td >
< td >
< strong > Vote </ strong >
</ td >
< td >
< strong > Bounty </ strong >
</ td >
< td >
< strong > Added </ strong >
</ td >
</ tr >
< ?
2013-09-13 08:00:53 +00:00
$Row = 0 ;
$Requests = Requests :: get_requests ( array_keys ( $SphRequests ));
foreach ( $SphRequests as $RequestID => $SphRequest ) {
$Request = $Requests [ $RequestID ];
$VotesCount = $SphRequest [ 'votes' ];
$Bounty = $SphRequest [ 'bounty' ] * 1024 ; // Sphinx stores bounty in kB
$CategoryName = $Categories [ $Request [ 'CategoryID' ] - 1 ];
2012-10-11 08:00:15 +00:00
2013-04-15 08:00:54 +00:00
if ( $CategoryName == 'Music' ) {
2013-05-13 08:00:33 +00:00
$ArtistForm = Requests :: get_artists ( $RequestID );
2012-10-11 08:00:15 +00:00
$ArtistLink = Artists :: display_artists ( $ArtistForm , true , true );
2013-09-13 08:00:53 +00:00
$FullName = " $ArtistLink <a href= \" requests.php?action=view&id= $RequestID\ " > $Request [ Title ] [ $Request [ Year ]] </ a > " ;
2013-04-15 08:00:54 +00:00
} elseif ( $CategoryName == 'Audiobooks' || $CategoryName == 'Comedy' ) {
2013-09-13 08:00:53 +00:00
$FullName = " <a href= \" requests.php?action=view&id= $RequestID\ " > $Request [ Title ] [ $Request [ Year ]] </ a > " ;
2011-03-28 14:21:28 +00:00
} else {
2013-09-13 08:00:53 +00:00
$FullName = " <a href= \" requests.php?action=view&id= $RequestID\ " > $Request [ Title ] </ a > " ;
2011-03-28 14:21:28 +00:00
}
?>
2013-09-13 08:00:53 +00:00
< tr class = " row<?=( $Row ++ & 1) ? 'a' : 'b'?> " >
2011-03-28 14:21:28 +00:00
< td >
2013-04-13 08:00:19 +00:00
< ? = $FullName ?>
2011-03-28 14:21:28 +00:00
< div class = " tags " >
2012-10-11 08:00:15 +00:00
< ?
2011-03-28 14:21:28 +00:00
$Tags = $Request [ 'Tags' ];
$TagList = array ();
2013-04-13 08:00:19 +00:00
foreach ( $Tags as $TagID => $TagName ) {
2013-05-21 08:01:09 +00:00
$TagList [] = " <a href= \" requests.php?tags= $TagName\ " > " .display_str( $TagName ).'</a>';
2011-03-28 14:21:28 +00:00
}
$TagList = implode ( ', ' , $TagList );
?>
2013-09-13 08:00:53 +00:00
< ? = $TagList ?>
2011-03-28 14:21:28 +00:00
</ div >
</ td >
< td >
2013-09-13 08:00:53 +00:00
< span id = " vote_count_<?= $RequestID ?> " >< ? = $VotesCount ?> </span>
2013-04-13 08:00:19 +00:00
< ? if ( check_perms ( 'site_vote' )) { ?>
2013-02-18 08:00:22 +00:00
& nbsp ; & nbsp ; < a href = " javascript:Vote(0, <?= $RequestID ?>) " class = " brackets " >+</ a >
2012-10-11 08:00:15 +00:00
< ? } ?>
2011-03-28 14:21:28 +00:00
</ td >
< td >
2012-10-11 08:00:15 +00:00
< span id = " bounty_<?= $RequestID ?> " >< ? = Format :: get_size ( $Bounty ) ?> </span>
2011-03-28 14:21:28 +00:00
</ td >
< td >
2013-09-13 08:00:53 +00:00
< ? = time_diff ( $Request [ 'TimeAdded' ]) ?>
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
< ? } ?>
</ table >
</ div >
</ div >
< ?
}
}
2011-08-22 08:00:05 +00:00
2013-09-11 08:00:55 +00:00
$IsFLS = isset ( $LoggedUser [ 'ExtraClasses' ][ FLS_TEAM ]);
2012-10-11 08:00:15 +00:00
if ( check_perms ( 'users_mod' , $Class ) || $IsFLS ) {
2012-03-28 08:00:20 +00:00
$UserLevel = $LoggedUser [ 'EffectiveClass' ];
2013-05-15 08:00:54 +00:00
$DB -> query ( "
SELECT
SQL_CALC_FOUND_ROWS
ID ,
Subject ,
Status ,
Level ,
AssignedToUser ,
Date ,
ResolverID
FROM staff_pm_conversations
WHERE UserID = $UserID
2013-06-24 08:00:28 +00:00
AND ( Level <= $UserLevel OR AssignedToUser = '".$LoggedUser[' ID ']."' )
2013-05-15 08:00:54 +00:00
ORDER BY Date DESC " );
2013-07-10 00:08:53 +00:00
if ( $DB -> has_results ()) {
2011-08-22 08:00:05 +00:00
$StaffPMs = $DB -> to_array ();
?>
2013-04-30 18:18:07 +00:00
< div class = " box " id = " staffpms_box " >
< div class = " head " >
2013-06-17 08:01:02 +00:00
< a href = " #staffpms_box " class = " brackets anchor " > #</a> Staff PMs <a href="#" onclick="$('#staffpms').gtoggle(); return false;" class="brackets">View</a>
2013-04-30 18:18:07 +00:00
</ div >
2012-09-01 08:00:24 +00:00
< table width = " 100% " class = " message_table hidden " id = " staffpms " >
2011-08-22 08:00:05 +00:00
< tr class = " colhead " >
< td > Subject </ td >
< td > Date </ td >
2013-02-09 08:01:01 +00:00
< td > Assigned to </ td >
< td > Resolved by </ td >
2011-08-22 08:00:05 +00:00
</ tr >
2013-08-28 23:08:41 +00:00
< ?
foreach ( $StaffPMs as $StaffPM ) {
2013-09-11 08:00:55 +00:00
list ( $ID , $Subject , $Status , $Level , $AssignedToUser , $Date , $ResolverID ) = $StaffPM ;
2011-08-22 08:00:05 +00:00
// Get assigned
if ( $AssignedToUser == '' ) {
// Assigned to class
2013-05-15 08:00:54 +00:00
$Assigned = ( $Level == 0 ) ? 'First Line Support' : $ClassLevels [ $Level ][ 'Name' ];
2011-08-22 08:00:05 +00:00
// No + on Sysops
2013-04-13 08:00:19 +00:00
if ( $Assigned != 'Sysop' ) {
2013-05-15 08:00:54 +00:00
$Assigned .= '+' ;
2013-04-13 08:00:19 +00:00
}
2012-10-11 08:00:15 +00:00
2011-08-22 08:00:05 +00:00
} else {
// Assigned to user
2012-10-11 08:00:15 +00:00
$Assigned = Users :: format_username ( $UserID , true , true , true , true );
}
2011-08-22 08:00:05 +00:00
if ( $ResolverID ) {
2012-10-11 08:00:15 +00:00
$Resolver = Users :: format_username ( $ResolverID , true , true , true , true );
2011-08-22 08:00:05 +00:00
} else {
2013-05-15 08:00:54 +00:00
$Resolver = '(unresolved)' ;
2011-08-22 08:00:05 +00:00
}
2012-10-11 08:00:15 +00:00
2011-08-22 08:00:05 +00:00
?>
< tr >
< td >< a href = " staffpm.php?action=viewconv&id=<?= $ID ?> " >< ? = display_str ( $Subject ) ?> </a></td>
< td >< ? = time_diff ( $Date , 2 , true ) ?> </td>
< td >< ? = $Assigned ?> </td>
< td >< ? = $Resolver ?> </td>
</ tr >
2012-10-11 08:00:15 +00:00
< ? } ?>
2011-08-22 08:00:05 +00:00
</ table >
</ div >
2013-08-28 23:08:41 +00:00
< ?
}
2011-08-22 08:00:05 +00:00
}
2012-10-05 08:00:20 +00:00
// Displays a table of forum warnings viewable only to Forum Moderators
2013-04-13 08:00:19 +00:00
if ( $LoggedUser [ 'Class' ] == 650 && check_perms ( 'users_warn' , $Class )) {
2013-06-09 08:01:21 +00:00
$DB -> query ( "
SELECT Comment
FROM users_warnings_forums
WHERE UserID = '$UserID' " );
2012-08-28 08:00:14 +00:00
list ( $ForumWarnings ) = $DB -> next_record ();
2013-07-10 00:08:53 +00:00
if ( $DB -> has_results ()) {
2012-08-28 08:00:14 +00:00
?>
< div class = " box " >
2013-02-18 08:00:22 +00:00
< div class = " head " > Forum warnings </ div >
2012-08-28 08:00:14 +00:00
< div class = " pad " >
2013-05-15 08:00:54 +00:00
< div id = " forumwarningslinks " class = " AdminComment box " style = " width: 98%; " >< ? = $Text -> full_format ( $ForumWarnings ) ?> </div>
2012-08-28 08:00:14 +00:00
</ div >
</ div >
2012-10-11 08:00:15 +00:00
< ?
2012-08-28 08:00:14 +00:00
}
}
2011-08-22 08:00:05 +00:00
if ( check_perms ( 'users_mod' , $Class )) { ?>
2012-09-15 08:00:25 +00:00
< form class = " manage_form " name = " user " id = " form " action = " user.php " method = " post " >
2011-03-28 14:21:28 +00:00
< input type = " hidden " name = " action " value = " moderate " />
< input type = " hidden " name = " userid " value = " <?= $UserID ?> " />
< input type = " hidden " name = " auth " value = " <?= $LoggedUser['AuthKey'] ?> " />
2013-06-17 08:01:02 +00:00
< div class = " box box2 " id = " staff_notes_box " >
2013-04-30 18:18:07 +00:00
< div class = " head " >
2013-08-28 23:08:41 +00:00
< a href = " #staff_notes_box " class = " brackets anchor " > #</a> Staff Notes
2013-02-23 08:00:22 +00:00
< a href = " # " name = " admincommentbutton " onclick = " ChangeTo('text'); return false; " class = " brackets " > Edit </ a >
2013-06-17 08:01:02 +00:00
< a href = " # " onclick = " $ ('#staffnotes').gtoggle(); return false; " class = " brackets " > Toggle </ a >
2013-01-15 08:00:37 +00:00
</ div >
< div id = " staffnotes " class = " pad " >
2012-09-26 07:15:36 +00:00
< input type = " hidden " name = " comment_hash " value = " <?= $CommentHash ?> " />
2013-05-15 08:00:54 +00:00
< div id = " admincommentlinks " class = " AdminComment box " style = " width: 98%; " >< ? = $Text -> full_format ( $AdminComment ) ?> </div>
< textarea id = " admincomment " onkeyup = " resize('admincomment'); " class = " AdminComment hidden " name = " AdminComment " cols = " 65 " rows = " 26 " style = " width: 98%; " >< ? = display_str ( $AdminComment ) ?> </textarea>
2013-02-18 08:00:22 +00:00
< a href = " # " name = " admincommentbutton " onclick = " ChangeTo('text'); return false; " class = " brackets " > Toggle edit </ a >
2011-03-28 14:21:28 +00:00
< script type = " text/javascript " >
resize ( 'admincomment' );
</ script >
</ div >
</ div >
2013-04-30 18:18:07 +00:00
< table class = " layout " id = " user_info_box " >
2012-09-01 08:00:24 +00:00
< tr class = " colhead " >
2013-04-30 18:18:07 +00:00
< td colspan = " 2 " >
2013-08-28 23:08:41 +00:00
< a href = " #user_info_box " class = " brackets anchor " > #</a> User Information
2013-04-30 18:18:07 +00:00
</ td >
2011-03-28 14:21:28 +00:00
</ tr >
< ? if ( check_perms ( 'users_edit_usernames' , $Class )) { ?>
< tr >
< td class = " label " > Username :</ td >
< td >< input type = " text " size = " 20 " name = " Username " value = " <?=display_str( $Username )?> " /></ td >
</ tr >
< ?
}
if ( check_perms ( 'users_edit_titles' )) {
?>
< tr >
2013-02-18 08:00:22 +00:00
< td class = " label " > Custom title :</ td >
2013-08-28 23:08:41 +00:00
< td >< input type = " text " class = " wide_input_text " name = " Title " value = " <?=display_str( $CustomTitle )?> " /></ td >
2011-03-28 14:21:28 +00:00
</ tr >
< ?
}
2013-05-15 08:00:54 +00:00
if ( check_perms ( 'users_promote_below' , $Class ) || check_perms ( 'users_promote_to' , $Class - 1 )) {
2011-03-28 14:21:28 +00:00
?>
< tr >
2013-02-18 08:00:22 +00:00
< td class = " label " > Primary class :</ td >
2011-03-28 14:21:28 +00:00
< td >
< select name = " Class " >
< ?
foreach ( $ClassLevels as $CurClass ) {
2013-04-13 08:00:19 +00:00
if ( check_perms ( 'users_promote_below' , $Class ) && $CurClass [ 'ID' ] >= $LoggedUser [ 'EffectiveClass' ]) {
break ;
}
if ( $CurClass [ 'ID' ] > $LoggedUser [ 'EffectiveClass' ]) {
break ;
}
if ( $CurClass [ 'Secondary' ]) {
continue ;
}
if ( $Class === $CurClass [ 'Level' ]) {
$Selected = ' selected="selected"' ;
} else {
$Selected = '' ;
}
2011-03-28 14:21:28 +00:00
?>
2013-02-18 08:00:22 +00:00
< option value = " <?= $CurClass['ID'] ?> " < ? = $Selected ?> ><?=$CurClass['Name'].' ('.$CurClass['Level'].')'?></option>
2011-03-28 14:21:28 +00:00
< ? } ?>
</ select >
</ td >
</ tr >
< ?
}
if ( check_perms ( 'users_give_donor' )) {
?>
< tr >
< td class = " label " > Donor :</ td >
2013-02-18 08:00:22 +00:00
< td >< input type = " checkbox " name = " Donor " < ? if ( $Donor == 1 ) { ?> checked="checked"<? } ?> /></td>
2011-03-28 14:21:28 +00:00
</ tr >
< ?
}
2012-03-28 08:00:20 +00:00
if ( check_perms ( 'users_promote_below' ) || check_perms ( 'users_promote_to' )) { ?>
< tr >
2013-02-18 08:00:22 +00:00
< td class = " label " > Secondary classes :</ td >
2012-03-28 08:00:20 +00:00
< td >
2011-03-28 14:21:28 +00:00
< ?
2013-05-15 08:00:54 +00:00
$DB -> query ( "
SELECT p . ID , p . Name , l . UserID
FROM permissions AS p
LEFT JOIN users_levels AS l ON l . PermissionID = p . ID AND l . UserID = '$UserID'
WHERE p . Secondary = 1
ORDER BY p . Name " );
2012-03-28 08:00:20 +00:00
$i = 0 ;
while ( list ( $PermID , $PermName , $IsSet ) = $DB -> next_record ()) {
$i ++ ;
?>
2013-02-18 08:00:22 +00:00
< input type = " checkbox " id = " perm_<?= $PermID ?> " name = " secondary_classes[] " value = " <?= $PermID ?> " < ? if ( $IsSet ) { ?> checked="checked"<? } ?> /> <label for="perm_<?=$PermID?>" style="margin-right: 10px;"><?=$PermName?></label>
2013-08-28 23:08:41 +00:00
< ? if ( $i % 3 == 0 ) {
echo " \t \t \t \t <br /> \n " ;
2013-04-13 08:00:19 +00:00
}
2012-03-28 08:00:20 +00:00
} ?>
</ td >
</ tr >
< ? }
2011-03-28 14:21:28 +00:00
if ( check_perms ( 'users_make_invisible' )) {
?>
< tr >
2013-02-18 08:00:22 +00:00
< td class = " label " > Visible in peer lists :</ td >
< td >< input type = " checkbox " name = " Visible " < ? if ( $Visible == 1 ) { ?> checked="checked"<? } ?> /></td>
2011-03-28 14:21:28 +00:00
</ tr >
< ?
}
2013-06-24 08:00:28 +00:00
if ( check_perms ( 'users_edit_ratio' , $Class ) || ( check_perms ( 'users_edit_own_ratio' ) && $UserID == $LoggedUser [ 'ID' ])) {
2011-03-28 14:21:28 +00:00
?>
< tr >
2013-08-28 23:08:41 +00:00
< td class = " label tooltip " title = " Upload amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end. " > Uploaded :</ span ></ td >
2011-03-28 14:21:28 +00:00
< td >
< input type = " hidden " name = " OldUploaded " value = " <?= $Uploaded ?> " />
< input type = " text " size = " 20 " name = " Uploaded " value = " <?= $Uploaded ?> " />
</ td >
</ tr >
< tr >
2013-08-28 23:08:41 +00:00
< td class = " label tooltip " title = " Download amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end. " > Downloaded :</ span ></ td >
2011-03-28 14:21:28 +00:00
< td >
< input type = " hidden " name = " OldDownloaded " value = " <?= $Downloaded ?> " />
< input type = " text " size = " 20 " name = " Downloaded " value = " <?= $Downloaded ?> " />
</ td >
</ tr >
< tr >
2013-08-28 23:08:41 +00:00
< td class = " label tooltip " title = " Enter a username. " > Merge stats < strong > from :</ strong ></ td >
2011-03-28 14:21:28 +00:00
< td >
< input type = " text " size = " 40 " name = " MergeStatsFrom " />
</ td >
</ tr >
2011-10-27 08:00:15 +00:00
< tr >
2013-02-18 08:00:22 +00:00
< td class = " label " > Freeleech tokens :</ td >
2011-10-08 08:00:14 +00:00
< td >
< input type = " text " size = " 5 " name = " FLTokens " value = " <?= $FLTokens ?> " />
</ td >
2011-10-27 08:00:15 +00:00
</ tr >
2011-03-28 14:21:28 +00:00
< ?
}
if ( check_perms ( 'users_edit_invites' )) {
?>
< tr >
2013-08-28 23:08:41 +00:00
< td class = " label tooltip " title = " Number of invites " > Invites :</ span ></ td >
2011-03-28 14:21:28 +00:00
< td >< input type = " text " size = " 5 " name = " Invites " value = " <?= $Invites ?> " /></ td >
</ tr >
< ?
}
if ( check_perms ( 'admin_manage_fls' ) || ( check_perms ( 'users_mod' ) && $OwnProfile )) {
?>
< tr >
2013-08-28 23:08:41 +00:00
< td class = " label tooltip " title = " This is the message shown in the right-hand column on /staff.php " > FLS / Staff remark :</ span ></ td >
< td >< input type = " text " class = " wide_input_text " name = " SupportFor " value = " <?=display_str( $SupportFor )?> " /></ td >
2011-03-28 14:21:28 +00:00
</ tr >
< ?
}
if ( check_perms ( 'users_edit_reset_keys' )) {
?>
< tr >
< td class = " label " > Reset :</ td >
< td >
2013-02-18 08:00:22 +00:00
< input type = " checkbox " name = " ResetRatioWatch " id = " ResetRatioWatch " /> < label for = " ResetRatioWatch " > Ratio watch </ label > |
2011-03-28 14:21:28 +00:00
< input type = " checkbox " name = " ResetPasskey " id = " ResetPasskey " /> < label for = " ResetPasskey " > Passkey </ label > |
< input type = " checkbox " name = " ResetAuthkey " id = " ResetAuthkey " /> < label for = " ResetAuthkey " > Authkey </ label > |
2013-02-18 08:00:22 +00:00
< input type = " checkbox " name = " ResetIPHistory " id = " ResetIPHistory " /> < label for = " ResetIPHistory " > IP history </ label > |
< input type = " checkbox " name = " ResetEmailHistory " id = " ResetEmailHistory " /> < label for = " ResetEmailHistory " > Email history </ label >
2011-03-28 14:21:28 +00:00
< br />
2013-02-18 08:00:22 +00:00
< input type = " checkbox " name = " ResetSnatchList " id = " ResetSnatchList " /> < label for = " ResetSnatchList " > Snatch list </ label > |
< input type = " checkbox " name = " ResetDownloadList " id = " ResetDownloadList " /> < label for = " ResetDownloadList " > Download list </ label >
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
< ?
}
if ( check_perms ( 'users_mod' )) {
?>
< tr >
2013-02-18 08:00:22 +00:00
< td class = " label " > Reset all EAC v0 . 95 logs to :</ td >
2011-03-28 14:21:28 +00:00
< td >
< select name = " 095logs " >
< option value = " " ></ option >
< option value = " 99 " > 99 </ option >
< option value = " 100 " > 100 </ option >
</ select >
</ td >
</ tr >
< ? }
if ( check_perms ( 'users_edit_password' )) {
?>
< tr >
2013-02-18 08:00:22 +00:00
< td class = " label " > New password :</ td >
2011-03-28 14:21:28 +00:00
< td >
< input type = " text " size = " 30 " id = " change_password " name = " ChangePassword " />
2013-07-23 08:00:41 +00:00
< button type = " button " id = " random_password " > Generate </ button >
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
< ? } ?>
2013-06-17 08:01:02 +00:00
</ table >
2011-03-28 14:21:28 +00:00
< ? if ( check_perms ( 'users_warn' )) { ?>
2013-04-30 18:18:07 +00:00
< table class = " layout " id = " warn_user_box " >
2011-03-28 14:21:28 +00:00
< tr class = " colhead " >
2013-04-30 18:18:07 +00:00
< td colspan = " 2 " >
2013-08-28 23:08:41 +00:00
< a href = " #warn_user_box " class = " brackets anchor " > #</a> Warnings
2013-04-30 18:18:07 +00:00
</ td >
2011-03-28 14:21:28 +00:00
</ tr >
< tr >
< td class = " label " > Warned :</ td >
< td >
2013-02-18 08:00:22 +00:00
< input type = " checkbox " name = " Warned " < ? if ( $Warned != '0000-00-00 00:00:00' ) { ?> checked="checked"<? } ?> />
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
2013-05-15 08:00:54 +00:00
< ? if ( $Warned == '0000-00-00 00:00:00' ) { // user is not warned ?>
2011-03-28 14:21:28 +00:00
< tr >
< td class = " label " > Expiration :</ td >
< td >
< select name = " WarnLength " >
< option value = " " >---</ option >
2013-02-23 08:00:22 +00:00
< option value = " 1 " > 1 week </ option >
< option value = " 2 " > 2 weeks </ option >
< option value = " 4 " > 4 weeks </ option >
< option value = " 8 " > 8 weeks </ option >
2011-03-28 14:21:28 +00:00
</ select >
</ td >
</ tr >
< ? } else { // user is warned ?>
< tr >
< td class = " label " > Extension :</ td >
< td >
2013-08-28 23:08:41 +00:00
< select name = " ExtendWarning " onchange = " ToggleWarningAdjust(this); " >
2012-03-03 08:00:28 +00:00
< option >---</ option >
2013-02-23 08:00:22 +00:00
< option value = " 1 " > 1 week </ option >
< option value = " 2 " > 2 weeks </ option >
< option value = " 4 " > 4 weeks </ option >
< option value = " 8 " > 8 weeks </ option >
2012-03-03 08:00:28 +00:00
</ select >
</ td >
</ tr >
< tr id = " ReduceWarningTR " >
< td class = " label " > Reduction :</ td >
< td >
2012-09-15 08:00:25 +00:00
< select name = " ReduceWarning " >
2011-03-28 14:21:28 +00:00
< option >---</ option >
2013-02-23 08:00:22 +00:00
< option value = " 1 " > 1 week </ option >
< option value = " 2 " > 2 weeks </ option >
< option value = " 4 " > 4 weeks </ option >
< option value = " 8 " > 8 weeks </ option >
2011-03-28 14:21:28 +00:00
</ select >
</ td >
</ tr >
< ? } ?>
< tr >
2013-08-28 23:08:41 +00:00
< td class = " label tooltip " title = " This message *will* be sent to the user in the warning PM! " > Warning reason :</ span ></ td >
2011-03-28 14:21:28 +00:00
< td >
2013-08-28 23:08:41 +00:00
< input type = " text " class = " wide_input_text " name = " WarnReason " />
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
< ? } ?>
2013-06-17 08:01:02 +00:00
</ table >
2013-04-30 18:18:07 +00:00
< table class = " layout " id = " user_privs_box " >
< tr class = " colhead " >
< td colspan = " 2 " >
2013-08-28 23:08:41 +00:00
< a href = " #user_privs_box " class = " brackets anchor " > #</a> User Privileges
2013-04-30 18:18:07 +00:00
</ td >
</ tr >
2011-03-28 14:21:28 +00:00
< ? if ( check_perms ( 'users_disable_posts' ) || check_perms ( 'users_disable_any' )) {
2013-05-15 08:00:54 +00:00
$DB -> query ( "
SELECT DISTINCT Email , IP
FROM users_history_emails
WHERE UserID = $UserID
ORDER BY Time ASC " );
2011-03-28 14:21:28 +00:00
$Emails = $DB -> to_array ();
?>
< tr >
< td class = " label " > Disable :</ td >
< td >
2013-04-17 08:00:58 +00:00
< input type = " checkbox " name = " DisablePosting " id = " DisablePosting " < ? if ( $DisablePosting == 1 ) { ?> checked="checked"<? } ?> /> <label for="DisablePosting">Posting</label>
2013-02-07 08:00:47 +00:00
< ? if ( check_perms ( 'users_disable_any' )) { ?> |
2013-04-17 08:00:58 +00:00
< input type = " checkbox " name = " DisableAvatar " id = " DisableAvatar " < ? if ( $DisableAvatar == 1 ) { ?> checked="checked"<? } ?> /> <label for="DisableAvatar">Avatar</label> |
< input type = " checkbox " name = " DisableForums " id = " DisableForums " < ? if ( $DisableForums == 1 ) { ?> checked="checked"<? } ?> /> <label for="DisableForums">Forums</label> |
2013-08-28 23:08:41 +00:00
< input type = " checkbox " name = " DisableIRC " id = " DisableIRC " < ? if ( $DisableIRC == 1 ) { ?> checked="checked"<? } ?> /> <label for="DisableIRC">IRC</label> |
2013-04-17 08:00:58 +00:00
< input type = " checkbox " name = " DisablePM " id = " DisablePM " < ? if ( $DisablePM == 1 ) { ?> checked="checked"<? } ?> /> <label for="DisablePM">PM</label> |
2013-08-28 23:08:41 +00:00
< br />< br />
< input type = " checkbox " name = " DisableLeech " id = " DisableLeech " < ? if ( $DisableLeech == 0 ) { ?> checked="checked"<? } ?> /> <label for="DisableLeech">Leech</label> |
< input type = " checkbox " name = " DisableRequests " id = " DisableRequests " < ? if ( $DisableRequests == 1 ) { ?> checked="checked"<? } ?> /> <label for="DisableRequests">Requests</label> |
< input type = " checkbox " name = " DisableUpload " id = " DisableUpload " < ? if ( $DisableUpload == 1 ) { ?> checked="checked"<? } ?> /> <label for="DisableUpload">Torrent upload</label>
< br />< br />
< input type = " checkbox " name = " DisableTagging " id = " DisableTagging " < ? if ( $DisableTagging == 1 ) { ?> checked="checked"<? } ?> /> <label for="DisableTagging" class="tooltip" title="This only disables a user's ability to delete tags.">Tagging</label> |
< input type = " checkbox " name = " DisableWiki " id = " DisableWiki " < ? if ( $DisableWiki == 1 ) { ?> checked="checked"<? } ?> /> <label for="DisableWiki">Wiki</label>
< br />< br />
< input type = " checkbox " name = " DisableInvites " id = " DisableInvites " < ? if ( $DisableInvites == 1 ) { ?> checked="checked"<? } ?> /> <label for="DisableInvites">Invites</label>
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
< tr >
< td class = " label " > Hacked :</ td >
< td >
2012-10-11 08:00:15 +00:00
< input type = " checkbox " name = " SendHackedMail " id = " SendHackedMail " /> < label for = " SendHackedMail " > Send hacked account email </ label > to
2011-03-28 14:21:28 +00:00
< select name = " HackedEmail " >
< ?
2013-04-13 08:00:19 +00:00
foreach ( $Emails as $Email ) {
2011-03-28 14:21:28 +00:00
list ( $Address , $IP ) = $Email ;
?>
< option value = " <?=display_str( $Address )?> " >< ? = display_str ( $Address ) ?> - <?=display_str($IP)?></option>
< ? } ?>
</ select >
</ td >
</ tr >
< ? } ?>
< ?
}
if ( check_perms ( 'users_disable_any' )) {
?>
< tr >
< td class = " label " > Account :</ td >
< td >
< select name = " UserStatus " >
2013-06-24 08:00:28 +00:00
< option value = " 0 " < ? if ( $Enabled == '0' ) { ?> selected="selected"<? } ?>>Unconfirmed</option>
< option value = " 1 " < ? if ( $Enabled == '1' ) { ?> selected="selected"<? } ?>>Enabled</option>
< option value = " 2 " < ? if ( $Enabled == '2' ) { ?> selected="selected"<? } ?>>Disabled</option>
2011-03-28 14:21:28 +00:00
< ? if ( check_perms ( 'users_delete_users' )) { ?>
2013-04-30 18:18:07 +00:00
< optgroup label = " -- WARNING -- " >
< option value = " delete " > Delete account </ option >
</ optgroup >
2011-03-28 14:21:28 +00:00
< ? } ?>
</ select >
</ td >
</ tr >
< tr >
2013-02-18 08:00:22 +00:00
< td class = " label " > User reason :</ td >
2011-03-28 14:21:28 +00:00
< td >
2013-08-28 23:08:41 +00:00
< input type = " text " class = " wide_input_text " name = " UserReason " />
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
< tr >
2013-08-28 23:08:41 +00:00
< td class = " label tooltip " title = " Enter a comma-delimited list of forum IDs. " > Restricted forums :</ span ></ td >
2011-10-11 08:00:15 +00:00
< td >
2013-08-28 23:08:41 +00:00
< input type = " text " class = " wide_input_text " name = " RestrictedForums " value = " <?=display_str( $RestrictedForums )?> " />
2011-10-11 08:00:15 +00:00
</ td >
</ tr >
< tr >
2013-08-28 23:08:41 +00:00
< td class = " label tooltip " title = " Enter a comma-delimited list of forum IDs. " > Extra forums :</ span ></ td >
2011-10-11 08:00:15 +00:00
< td >
2013-08-28 23:08:41 +00:00
< input type = " text " class = " wide_input_text " name = " PermittedForums " value = " <?=display_str( $PermittedForums )?> " />
2011-10-11 08:00:15 +00:00
</ td >
</ tr >
2011-03-28 14:21:28 +00:00
< ? } ?>
2013-06-17 08:01:02 +00:00
</ table >
2013-04-13 08:00:19 +00:00
< ? if ( check_perms ( 'users_logout' )) { ?>
2013-04-30 18:18:07 +00:00
< table class = " layout " id = " session_box " >
< tr class = " colhead " >
< td colspan = " 2 " >
2013-05-28 08:01:02 +00:00
< a href = " #session_box " class = " brackets anchor " > #</a> Session
2013-04-30 18:18:07 +00:00
</ td >
</ tr >
2011-03-28 14:21:28 +00:00
< tr >
< td class = " label " > Reset session :</ td >
< td >< input type = " checkbox " name = " ResetSession " id = " ResetSession " /></ td >
</ tr >
< tr >
< td class = " label " > Log out :</ td >
< td >< input type = " checkbox " name = " LogOut " id = " LogOut " /></ td >
</ tr >
</ table >
< ? } ?>
2013-10-01 23:08:42 +00:00
< ? if ( check_perms ( " users_mod " )) {
DonationsView :: render_mod_donations ( $UserID );
}
2013-08-28 23:08:41 +00:00
?>
2013-04-30 18:18:07 +00:00
< table class = " layout " id = " submit_box " >
< tr class = " colhead " >
< td colspan = " 2 " >
2013-05-28 08:01:02 +00:00
< a href = " #submit_box " class = " brackets anchor " > #</a> Submit
2013-04-30 18:18:07 +00:00
</ td >
</ tr >
2011-03-28 14:21:28 +00:00
< tr >
2013-08-28 23:08:41 +00:00
< td class = " label tooltip " title = " This message will be entered into staff notes only. " > Reason :</ span ></ td >
2011-03-28 14:21:28 +00:00
< td >
2013-08-28 23:08:41 +00:00
< textarea rows = " 1 " class = " wide_input_text " name = " Reason " id = " Reason " onkeyup = " resize('Reason'); " ></ textarea >
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
2013-08-22 08:00:54 +00:00
< tr >
2013-08-23 08:00:54 +00:00
< td class = " label " > Paste user stats :</ td >
2013-08-22 08:00:54 +00:00
< td >
2013-08-23 08:00:54 +00:00
< button type = " button " id = " paster " > Paste </ button >
2013-08-22 08:00:54 +00:00
</ td >
</ tr >
2013-08-23 08:00:54 +00:00
2011-03-28 14:21:28 +00:00
< tr >
< td align = " right " colspan = " 2 " >
2013-02-18 08:00:22 +00:00
< input type = " submit " value = " Save changes " />
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
</ table >
</ form >
2013-08-28 23:08:41 +00:00
< ? }
?>
2011-03-28 14:21:28 +00:00
</ div >
</ div >
2012-10-11 08:00:15 +00:00
< ? View :: show_footer (); ?>