Empty commit

This commit is contained in:
Git 2013-10-19 08:01:09 +00:00
parent c2c3a83ea0
commit a8f3922ffb
13 changed files with 207 additions and 154 deletions

View File

@ -16,11 +16,11 @@ function time_ago($TimeStamp) {
return time() - $TimeStamp;
}
function time_diff($TimeStamp, $Levels = 2, $Span = true, $Lowercase = false) {
/*
Returns a <span> by default but can optionally return the raw time
difference in text (e.g. "16 hours and 28 minutes", "1 day, 18 hours").
/*
* Returns a <span> by default but can optionally return the raw time
* difference in text (e.g. "16 hours and 28 minutes", "1 day, 18 hours").
*/
function time_diff($TimeStamp, $Levels = 2, $Span = true, $Lowercase = false) {
if (!is_number($TimeStamp)) { // Assume that $TimeStamp is SQL timestamp
if ($TimeStamp == '0000-00-00 00:00:00') {
return 'Never';

View File

@ -630,19 +630,19 @@ public static function show_avatar($Avatar, $UserID, $Username, $Setting, $Size
if (!empty($AvatarMouseOverText)) {
$AvatarMouseOverText = "title=\"$AvatarMouseOverText\" alt=\"$AvatarMouseOverText\"";
} else {
$AvatarMouseOverText = "alt=\"\"";
$AvatarMouseOverText = "alt=\"$Username's avatar\"";
}
if ($EnabledRewards['HasSecondAvatar'] && !empty($Rewards['SecondAvatar'])) {
$SecondAvatar = 'data-gazelle-second-avatar="' . ImageTools::process($Rewards['SecondAvatar']) . '"';
$SecondAvatar = ' data-gazelle-second-avatar="' . ImageTools::process($Rewards['SecondAvatar']) . '"';
}
// case 1 is avatars disabled
switch ($Setting) {
case 0:
if (!empty($Avatar)) {
$ToReturn = ($ReturnHTML ? "<img src=\"$Avatar\" width=\"$Size\" $Style $AvatarMouseOverText $SecondAvatar $Class />" : $Avatar);
$ToReturn = ($ReturnHTML ? "<img src=\"$Avatar\" width=\"$Size\" $Style $AvatarMouseOverText$SecondAvatar $Class />" : $Avatar);
} else {
$URL = STATIC_SERVER.'common/avatars/default.png';
$ToReturn = ($ReturnHTML ? "<img src=\"$URL\" width=\"$Size\" $Style $AvatarMouseOverText $SecondAvatar />" : $URL);
$ToReturn = ($ReturnHTML ? "<img src=\"$URL\" width=\"$Size\" $Style $AvatarMouseOverText$SecondAvatar />" : $URL);
}
break;
case 2:
@ -683,14 +683,14 @@ public static function show_avatar($Avatar, $UserID, $Username, $Setting, $Size
$URL = 'https://robohash.org/'.md5($Username)."?set=set$Type&amp;size={$Size}x$Size";
}
if ($ShowAvatar == true && !empty($Avatar)) {
$ToReturn = ($ReturnHTML ? "<img src=\"$Avatar\" width=\"$Size\" $Style $AvatarMouseOverText $SecondAvatar $Class/>" : $Avatar);
$ToReturn = ($ReturnHTML ? "<img src=\"$Avatar\" width=\"$Size\" $Style $AvatarMouseOverText$SecondAvatar $Class/>" : $Avatar);
} else {
$ToReturn = ($ReturnHTML ? "<img src=\"$URL\" width=\"$Size\" $Style $AvatarMouseOverText $SecondAvatar $Class/>" : $URL);
$ToReturn = ($ReturnHTML ? "<img src=\"$URL\" width=\"$Size\" $Style $AvatarMouseOverText$SecondAvatar $Class/>" : $URL);
}
break;
default:
$URL = STATIC_SERVER.'common/avatars/default.png';
$ToReturn = ($ReturnHTML ? "<img src=\"$URL\" width=\"$Size\" $Style $AvatarMouseOverText $SecondAvatar $Class/>" : $URL);
$ToReturn = ($ReturnHTML ? "<img src=\"$URL\" width=\"$Size\" $Style $AvatarMouseOverText$SecondAvatar $Class/>" : $URL);
}
return $ToReturn;
}

View File

@ -31,7 +31,7 @@
<strong>Time:</strong> <span><?=number_format(((microtime(true) - $ScriptStartTime) * 1000), 5)?> ms</span>
<strong>Used:</strong> <span><?=Format::get_size(memory_get_usage(true))?></span>
<strong>Load:</strong> <span><?=number_format($Load[0], 2).' '.number_format($Load[1], 2).' '.number_format($Load[2], 2)?></span>
<strong>Date:</strong> <span><?=date('M d Y, H:i')?></span>
<strong>Date:</strong> <span id="site_date"><?=date('M d Y')?></span>, <span id="site_time"><?=date('H:i')?></span>
</p>
</div>

View File

@ -377,9 +377,9 @@
// Inbox
if ($NotificationsManager->is_traditional(NotificationsManager::INBOX)) {
$NotificationsManager->load_inbox();
$NewMessages = $NotificationsManager->get_notifications()[NotificationsManager::INBOX];
if (isset($NewMessages)) {
$Alerts[] = NotificationsManagerView::format_traditional($NewMessages);
$NewMessages = $NotificationsManager->get_notifications();
if (isset($NewMessages[NotificationsManager::INBOX])) {
$Alerts[] = NotificationsManagerView::format_traditional($NewMessages[NotificationsManager::INBOX]);
}
$NotificationsManager->clear_notifications_array();
}
@ -393,9 +393,9 @@
// Torrents
if ($NotificationsManager->is_traditional(NotificationsManager::TORRENTS)) {
$NotificationsManager->load_torrent_notifications();
$NewTorrents = $NotificationsManager->get_notifications()[NotificationsManager::TORRENTS];
if (isset($NewTorrents)) {
$Alerts[] = NotificationsManagerView::format_traditional($NewTorrents);
$NewTorrents = $NotificationsManager->get_notifications();
if (isset($NewTorrents[NotificationsManager::TORRENTS])) {
$Alerts[] = NotificationsManagerView::format_traditional($NewTorrents[NotificationsManager::TORRENTS]);
}
$NotificationsManager->clear_notifications_array();
}

View File

@ -94,11 +94,11 @@
</td>
</tr>
<tr>
<? if (Users::has_avatars_enabled()) { ?>
<? if (Users::has_avatars_enabled()) { ?>
<td class="avatar" valign="top">
<?=Users::show_avatar(G::$LoggedUser['Avatar'], G::$LoggedUser['ID'], G::$LoggedUser['Username'], $HeavyInfo['DisableAvatars'])?>
</td>
<? } ?>
<? } ?>
<td class="body" valign="top">
<div id="contentpreview" style="text-align: left;">
<div id="preview_<?=$ReplyText->getID()?>"></div>
@ -106,7 +106,7 @@
</td>
</tr>
</table>
<form class="send_form center" name="reply" id="quickpostform" action="<?=$Action?>" method="post"<? if (!check_perms('users_mod')) { ?> onsubmit="quickpostform.submit_button.disabled=true;" <? } ?>>
<form class="send_form center" name="reply" id="quickpostform" action="<?=$Action?>" method="post"<? if (!check_perms('users_mod')) { ?> onsubmit="quickpostform.submit_button.disabled = true;"<? } ?>>
<input type="hidden" name="action" value="<?=$InputAction?>" />
<input type="hidden" name="auth" value="<?=G::$LoggedUser['AuthKey']?>" />
<input type="hidden" name="<?=$InputName?>" value="<?=$InputID?>" />
@ -118,7 +118,8 @@
</div>
<div class="preview_submit">
<?
if (isset($SubscribeBox) && !isset($ForumID) && Subscriptions::has_subscribed_comments($Document, $InputID) === false) { ?>
if (isset($SubscribeBox) && !isset($ForumID) && Subscriptions::has_subscribed_comments($Document, $InputID) === false) {
?>
<input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe']) ? ' checked="checked"' : ''?> tabindex="2" />
<label for="subscribebox">Subscribe</label>
<?
@ -126,7 +127,8 @@
// Forum thread logic
// This might use some more abstraction
if (isset($ForumID)) {
if (!Subscriptions::has_subscribed($InputID)) { ?>
if (!Subscriptions::has_subscribed($InputID)) {
?>
<input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe']) ? ' checked="checked"' : ''?> tabindex="2" />
<label for="subscribebox">Subscribe</label>
<?
@ -138,10 +140,15 @@
?>
<input id="mergebox" type="checkbox" name="merge" tabindex="2" />
<label for="mergebox">Merge</label>
<? }
if (!G::$LoggedUser['DisableAutoSave']) { ?>
<script type="application/javascript">var storedTempTextarea = new StoreText('quickpost', 'quickpostform', <?=$InputID?>);</script>
<? }
<?
}
if (!G::$LoggedUser['DisableAutoSave']) {
?>
<script type="application/javascript">
var storedTempTextarea = new StoreText('quickpost', 'quickpostform', <?=$InputID?>);
</script>
<?
}
}
?>
<input type="button" value="Preview" class="hidden button_preview_<?=$ReplyText->getID()?>" title="Preview text" tabindex="1" />

View File

@ -770,14 +770,6 @@ CREATE TABLE `requests_votes` (
KEY `Bounty` (`Bounty`)
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `sacrifice` (
`UserID` int(10) NOT NULL,
`Time` datetime NOT NULL,
`Sacrifice1` text NOT NULL,
`Sacrifice2` text NOT NULL,
`IsValid` tinyint(4) NOT NULL
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `schedule` (
`NextHour` int(2) NOT NULL DEFAULT '0',
`NextDay` int(2) NOT NULL DEFAULT '0',

View File

@ -37,7 +37,7 @@
<a href="collages.php?id=<?=$CollageID?>"><?=$Name?></a>
</h2>
<div class="linkbox">
<a href="#" id="subscribelink_collages<?=$CollageID?>" class="brackets" onclick="SubscribeComments('collages',<?=$CollageID?>);return false;"><?=Subscriptions::has_subscribed_comments('collages', $CollageID) !== false ? 'Unsubscribe' : 'Subscribe'?></a>
<a href="#" id="subscribelink_collages<?=$CollageID?>" class="brackets" onclick="SubscribeComments('collages', <?=$CollageID?>); return false;"><?=Subscriptions::has_subscribed_comments('collages', $CollageID) !== false ? 'Unsubscribe' : 'Subscribe'?></a>
<?
$Pages = Format::get_pages($Page, $NumComments, TORRENT_COMMENTS_PER_PAGE, 9);
if ($Pages) {
@ -49,7 +49,7 @@
<?
//---------- Begin printing
CommentsView::render_comments($Thread, $LastRead, "collages.php?action=comments&collageid=$CollageID");
CommentsView::render_comments($Thread, $LastRead, "collages.php?action=comments&amp;collageid=$CollageID");
if (!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')) {
if ($ThreadInfo['MinClassWrite'] <= $LoggedUser['Class'] && !$LoggedUser['DisablePosting']) {
View::parse('generic/reply/quickreply.php', array(

View File

@ -19,11 +19,15 @@
FROM user_questions AS uq
WHERE uq.ID NOT IN
(
SELECT siq.QuestionID FROM staff_ignored_questions AS siq WHERE siq.UserID = '$LoggedUser[ID]'
SELECT siq.QuestionID
FROM staff_ignored_questions AS siq
WHERE siq.UserID = '$LoggedUser[ID]'
)
AND uq.ID NOT IN
(
SELECT sq.QuestionID FROM staff_answers AS sq WHERE sq.UserID = '$LoggedUser[ID]'
SELECT sq.QuestionID
FROM staff_answers AS sq
WHERE sq.UserID = '$LoggedUser[ID]'
)
ORDER BY uq.Date DESC");
$Questions = $DB->to_array();

View File

@ -236,10 +236,10 @@
?>
<tr>
<td>
<a href="user.php?id=<?=$User['UserID']?>"><?=($Boldify ? '<strong>' : '')?><?=display_str($User['Username'])?><?=($Boldify ? '</strong>' : '')?></a>
<a href="user.php?id=<?=$User['UserID']?>"><?=($Boldify ? '<strong>' : '') . display_str($User['Username']) . ($Boldify ? '</strong>' : '')?></a>
</td>
<td class="number_column">
<?=($Boldify ? '<strong>' : '')?><?=Format::get_size($User['Bounty'])?><?=($Boldify ? '</strong>' : '')?>
<?=($Boldify ? '<strong>' : '') . Format::get_size($User['Bounty']) . ($Boldify ? "</strong>\n" : "\n")?>
</td>
</tr>
<? }
@ -274,51 +274,38 @@
if (!empty($Request['RecordLabel'])) { ?>
<tr>
<td class="label">Record label</td>
<td>
<?=$Request['RecordLabel']?>
</td>
<td><?=$Request['RecordLabel']?></td>
</tr>
<? }
if (!empty($Request['CatalogueNumber'])) { ?>
<tr>
<td class="label">Catalogue number</td>
<td>
<?=$Request['CatalogueNumber']?>
</td>
<td><?=$Request['CatalogueNumber']?></td>
</tr>
<? } ?>
<tr>
<td class="label">Release type</td>
<td>
<?=$ReleaseName?>
</td>
<td><?=$ReleaseName?></td>
</tr>
<tr>
<td class="label">Acceptable bitrates</td>
<td>
<?=$BitrateString?>
</td>
<td><?=$BitrateString?></td>
</tr>
<tr>
<td class="label">Acceptable formats</td>
<td>
<?=$FormatString?>
</td>
<td><?=$FormatString?></td>
</tr>
<tr>
<td class="label">Acceptable media</td>
<td>
<?=$MediaString?>
</td>
<td><?=$MediaString?></td>
</tr>
<? if (!empty($Request['LogCue'])) { ?>
<tr>
<td class="label">Required CD FLAC only extras</td>
<td>
<?=$Request['LogCue']?>
</td>
<td><?=$Request['LogCue']?></td>
</tr>
<? }
<?
}
}
$Worldcat = '';
$OCLC = str_replace(' ', '', $Request['OCLC']);
@ -332,14 +319,14 @@
}
}
}
if (!empty($Worldcat)) { ?>
if (!empty($Worldcat)) {
?>
<tr>
<td class="label">WorldCat (OCLC) ID</td>
<td>
<?=$Worldcat?>
</td>
<td><?=$Worldcat?></td>
</tr>
<? }
<?
}
if ($Request['GroupID']) {
?>
<tr>
@ -360,12 +347,12 @@
<? if ($Request['LastVote'] > $Request['TimeAdded']) { ?>
<tr>
<td class="label">Last voted</td>
<td>
<?=time_diff($Request['LastVote'])?>
</td>
<td><?=time_diff($Request['LastVote'])?></td>
</tr>
<? }
if ($CanVote) { ?>
<?
}
if ($CanVote) {
?>
<tr id="voting">
<td class="label tooltip" title="These units are in base 2, not base 10. For example, there are 1,024 MB in 1 GB.">Custom vote (MB)</td>
<td>
@ -448,7 +435,9 @@
<td colspan="2" class="center"><strong>Description</strong></td>
</tr>
<tr>
<td colspan="2"><?=$Text->full_format($Request['Description']);?></td>
<td colspan="2">
<?= $Text->full_format($Request['Description']);?>
</td>
</tr>
</table>
<?
@ -465,20 +454,20 @@
<?
//---------- Begin printing
CommentsView::render_comments($Thread, $LastRead, "requests.php?action=view&id=$RequestID");
CommentsView::render_comments($Thread, $LastRead, "requests.php?action=view&amp;id=$RequestID");
if ($Pages) { ?>
<div class="linkbox pager"><?=$Pages?></div>
<?
}
View::parse('generic/reply/quickreply.php', array(
View::parse('generic/reply/quickreply.php', array(
'InputName' => 'pageid',
'InputID' => $RequestID,
'Action' => 'comments.php?page=requests',
'InputAction' => 'take_post',
'SubscribeBox' => true
));
));
?>
</div>
</div>

View File

@ -9,7 +9,10 @@
foreach ($_POST['item'] as $Position => $Item) {
$Position = db_string($Position);
$Item = db_string($Item);
$DB->query('UPDATE `do_not_upload` SET `Sequence` = ' . $Position . ' WHERE `id` = '. $Item);
$DB->query('
UPDATE `do_not_upload`
SET `Sequence` = ' . $Position . '
WHERE `id` = '. $Item);
}
} elseif ($_POST['submit'] == 'Delete') { //Delete
@ -20,7 +23,7 @@
DELETE FROM do_not_upload
WHERE ID = '.$_POST['id']);
} else { //Edit & Create, Shared Validation
$Val->SetFields('name', '1', 'string', 'The name must be set, has a maximum length of 100 characters, and has a minimum length of 5 characters.', array('maxlength' => 100, 'minlength' => 5));
$Val->SetFields('name', '1', 'string', 'The name must be set, have a maximum length of 100 characters, and have a minimum length of 5 characters.', array('maxlength' => 100, 'minlength' => 5));
$Val->SetFields('comment', '0', 'string', 'The description has a maximum length of 255 characters.', array('maxlength' => 255));
$Err = $Val->ValidateForm($_POST); // Validate the form
if ($Err) {

View File

@ -558,25 +558,41 @@ function filelist($Str) {
$Reports = $Cache->get_value("reports_torrent_$TorrentID");
if ($Reports === false) {
$DB->query("
SELECT r.ID,
SELECT
r.ID,
r.ReporterID,
r.Type,
r.UserComment,
r.ReportedTime
FROM reportsv2 AS r
WHERE TorrentID = $TorrentID
AND Type != 'edited'
AND Status != 'Resolved'");
$Reports = $DB->to_array();
$Cache->cache_value("reports_torrent_$TorrentID", $Reports, 0);
}
if (count($Reports) > 0) {
// used to see if we have any non-"edited log" reports to display
$NumNonEditedLogReports = 0;
foreach ($Reports as $Report) {
if ($Report['Type'] != 'edited') {
$NumNonEditedLogReports += 1;
}
}
/* for regular users, don't display the torrent reports table if there
* are 0 non-"edited log" reports.
* always let staff (e.g. permission "admin_reports") view "edited
* log" reports.
*/
if ($NumNonEditedLogReports > 0 || (check_perms('admin_reports') && $Reports)) {
$Reported = true;
include(SERVER_ROOT.'/sections/reportsv2/array.php');
$NumReports = check_perms('admin_reports') ? count($Reports) : $NumNonEditedLogReports;
$ReportInfo = '
<table class="reportinfo_table">
<tr class="colhead_dark" style="font-weight: bold;">
<td>This torrent has '.count($Reports).' active '.(count($Reports) > 1 ? 'reports' : 'report').":</td>
<td>This torrent has '.$NumReports.' active '.($NumReports === 1 ? 'report' : 'reports').":</td>
</tr>";
foreach ($Reports as $Report) {
@ -585,18 +601,27 @@ function filelist($Str) {
$Reporter = Users::user_info($ReporterID);
$ReporterName = $Reporter['Username'];
if ($ReportType == 'edited' && !check_perms('admin_reports')) {
// Edited Log report and the viewing user does not have adequate permission
continue;
}
if (array_key_exists($ReportType, $Types[$GroupCategoryID])) {
$ReportType = $Types[$GroupCategoryID][$ReportType];
} elseif (array_key_exists($ReportType,$Types['master'])) {
} elseif (array_key_exists($ReportType, $Types['master'])) {
$ReportType = $Types['master'][$ReportType];
} else {
//There was a type but it wasn't an option!
$ReportType = $Types['master']['other'];
}
$ReportInfo .= "\n\t<tr>\n\t\t<td>".(check_perms('admin_reports') ? "<a href=\"user.php?id=$ReporterID\">$ReporterName</a> <a href=\"reportsv2.php?view=report&amp;id=$ReportID\">reported it</a> " : 'Someone reported it ') . time_diff($ReportedTime, 2, true, true) . ' for the reason "' . $ReportType['title'] . '":';
$ReportInfo .= "\n<blockquote>".$Text->full_format($ReportReason)."</blockquote>\n\t\t</td>\n\t</tr>";
$ReportInfo .= "
<tr>
<td>".(check_perms('admin_reports') ? "<a href=\"user.php?id=$ReporterID\">$ReporterName</a> <a href=\"reportsv2.php?view=report&amp;id=$ReportID\">reported it</a> " : 'Someone reported it ') . time_diff($ReportedTime, 2, true, true) . ' for the reason "' . $ReportType['title'] . '":
<blockquote>'.$Text->full_format($ReportReason).'</blockquote>
</td>
</tr>';
}
$ReportInfo .= "\n</table>";
$ReportInfo .= "\n\t\t</table>";
}
$CanEdit = (check_perms('torrents_edit') || (($UserID == $LoggedUser['ID'] && !$LoggedUser['DisableWiki']) && !($Remastered && !$RemasterYear)));
@ -604,12 +629,15 @@ function filelist($Str) {
$RegenLink = check_perms('users_mod') ? ' <a href="torrents.php?action=regen_filelist&amp;torrentid='.$TorrentID.'" class="brackets">Regenerate</a>' : '';
$FileTable = '
<table class="filelist_table">
<tr class="colhead_dark"><td>
<tr class="colhead_dark">
<td>
<div class="filelist_title" style="float: left;">File Names' . $RegenLink . '</div>
<div class="filelist_path" style="float: right;">' . ($FilePath ? "/$FilePath/" : '') . '</div>
</td><td>
</td>
<td>
<strong>Size</strong>
</td></tr>';
</td>
</tr>';
if (substr($FileList, -3) == '}}}') { // Old style
$FileListSplit = explode('|||', $FileList);
foreach ($FileListSplit as $File) {

View File

@ -82,7 +82,7 @@
<?
}
if (($Override = check_paranoia_here('collagecontribs+'))) { ?>
<li id="comm_collstart"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collages contributed to: <? echo number_format($NumCollageContribs); ?>
<li id="comm_collcontrib"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collages contributed to: <? echo number_format($NumCollageContribs); ?>
<? if ($Override = check_paranoia_here('collagecontribs')) { ?>
<a href="collages.php?userid=<?=$UserID?>&amp;contrib=1" class="brackets<?=(($Override === 2) ? ' paranoia_override' : '')?>" title="View">View</a>
<? } ?>

View File

@ -26,10 +26,12 @@
$AvatarMouseOverText = '';
$SecondAvatar = '';
if ($EnabledRewards['HasAvatarMouseOverText'] && !empty($Rewards['AvatarMouseOverText'])) {
$AvatarMouseOverText = "title=\"$Rewards[AvatarMouseOverText]\" alt=\"$Rewards[AvatarMouseOverText]\"";
$AvatarMouseOverText = " title=\"$Rewards[AvatarMouseOverText]\" alt=\"$Rewards[AvatarMouseOverText]\"";
} else {
$AvatarMouseOverText = " alt=\"\"";
}
if ($EnabledRewards['HasSecondAvatar'] && !empty($Rewards['SecondAvatar'])) {
$SecondAvatar = 'data-gazelle-second-avatar="' . ImageTools::process($Rewards['SecondAvatar']) . '"';
$SecondAvatar = ' data-gazelle-second-avatar="' . ImageTools::process($Rewards['SecondAvatar']) . '"';
}
@ -187,7 +189,8 @@ function check_paranoia_here($Setting) {
<h2><?=Users::format_username($UserID, true, true, true, false, true)?></h2>
<div class="linkbox">
<?
if (!$OwnProfile) { ?>
if (!$OwnProfile) {
?>
<a href="inbox.php?action=compose&amp;to=<?=$UserID?>" class="brackets">Send message</a>
<?
$DB->query("
@ -195,7 +198,8 @@ function check_paranoia_here($Setting) {
FROM friends
WHERE UserID = '$LoggedUser[ID]'
AND FriendID = '$UserID'");
if (!$DB->has_results()) { ?>
if (!$DB->has_results()) {
?>
<a href="friends.php?action=add&amp;friendid=<?=$UserID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Add to friends</a>
<? } ?>
<a href="reports.php?action=report&amp;type=user&amp;id=<?=$UserID?>" class="brackets">Report user</a>
@ -211,32 +215,39 @@ function check_paranoia_here($Setting) {
if (check_perms('users_view_invites', $Class)) {
?>
<a href="user.php?action=invite&amp;userid=<?=$UserID?>" class="brackets">Invites</a>
<? }
<?
}
if (check_perms('admin_manage_permissions', $Class)) {
?>
<a href="user.php?action=permissions&amp;userid=<?=$UserID?>" class="brackets">Permissions</a>
<? }
<?
}
if (check_perms('users_logout', $Class) && check_perms('users_view_ips', $Class)) {
?>
<a href="user.php?action=sessions&amp;userid=<?=$UserID?>" class="brackets">Sessions</a>
<? }
<?
}
if (check_perms('admin_reports')) {
?>
<a href="reportsv2.php?view=reporter&amp;id=<?=$UserID?>" class="brackets">Reports</a>
<? }
<?
}
if (check_perms('users_mod')) {
?>
<a href="userhistory.php?action=token_history&amp;userid=<?=$UserID?>" class="brackets">FL tokens</a>
<? }
<?
}
if (check_perms('admin_clear_cache') && check_perms('users_override_paranoia')) {
?>
<a href="user.php?action=clearcache&amp;id=<?=$UserID?>" class="brackets">Clear cache</a>
<? } ?>
<?
}
?>
</div>
<div class="sidebar">
<?
if ($Avatar && Users::has_avatars_enabled()) {
if ($Avatar && Users::has_avatars_enabled()) {
// TODO: use Users::show_avatar; why is display_str() used a few lines below (where avatar is displayed)?
if (check_perms('site_proxy_images') && !empty($Avatar)) {
$Avatar = 'http'.($SSL ? 's' : '').'://'.SITE_URL.'/image.php?c=1&amp;avatar='.$UserID.'&amp;i='.urlencode($Avatar);
@ -244,32 +255,48 @@ function check_paranoia_here($Setting) {
?>
<div class="box box_image box_image_avatar">
<div class="head colhead_dark">Avatar</div>
<div align="center"><img class="avatar double_avatar" src="<?=display_str($Avatar)?>" width="150" style="max-height: 400px;" <?=$AvatarMouseOverText?> <?=$SecondAvatar?> /></div>
<div align="center">
<img class="avatar double_avatar" src="<?=display_str($Avatar)?>" width="150" style="max-height: 400px;"<?=$AvatarMouseOverText?><?=$SecondAvatar?> />
</div>
<? } ?>
</div>
<?
}
?>
<div class="box box_info box_userinfo_stats">
<div class="head colhead_dark">Statistics</div>
<ul class="stats nobullet">
<li>Joined: <?=$JoinedDate?></li>
<? if (($Override = check_paranoia_here('lastseen'))) { ?>
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Last seen: <?=$LastAccess?></li>
<? }
if (($Override = check_paranoia_here('uploaded'))) { ?>
<?
}
if (($Override = check_paranoia_here('uploaded'))) {
?>
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?> title="<?=Format::get_size($Uploaded, 5)?>">Uploaded: <?=Format::get_size($Uploaded)?></li>
<? }
if (($Override = check_paranoia_here('downloaded'))) { ?>
<?
}
if (($Override = check_paranoia_here('downloaded'))) {
?>
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?> title="<?=Format::get_size($Downloaded, 5)?>">Downloaded: <?=Format::get_size($Downloaded)?></li>
<? }
if (($Override = check_paranoia_here('ratio'))) { ?>
<?
}
if (($Override = check_paranoia_here('ratio'))) {
?>
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Ratio: <?=Format::get_ratio_html($Uploaded, $Downloaded)?></li>
<? }
if (($Override = check_paranoia_here('requiredratio')) && isset($RequiredRatio)) { ?>
<?
}
if (($Override = check_paranoia_here('requiredratio')) && isset($RequiredRatio)) {
?>
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Required Ratio: <?=number_format((double)$RequiredRatio, 2)?></li>
<? }
if ($OwnProfile || ($Override = check_paranoia_here(false)) || check_perms('users_mod')) { ?>
<?
}
if ($OwnProfile || ($Override = check_paranoia_here(false)) || check_perms('users_mod')) {
?>
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>><a href="userhistory.php?action=token_history&amp;userid=<?=$UserID?>">Tokens</a>: <?=number_format($FLTokens)?></li>
<? }
if (($OwnProfile || check_perms('users_mod')) && $Warned != '0000-00-00 00:00:00') { ?>
<?
}
if (($OwnProfile || check_perms('users_mod')) && $Warned != '0000-00-00 00:00:00') {
?>
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Warning expires in: <?=time_diff((date('Y-m-d H:i', strtotime($Warned))))?></li>
<? } ?>
</ul>
@ -1046,14 +1073,14 @@ function check_paranoia_here($Setting) {
if (check_perms('users_edit_ratio', $Class) || (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID'])) {
?>
<tr>
<td class="label tooltip" title="Upload amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end.">Uploaded:</span></td>
<td class="label tooltip" title="Upload amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end.">Uploaded:</td>
<td>
<input type="hidden" name="OldUploaded" value="<?=$Uploaded?>" />
<input type="text" size="20" name="Uploaded" value="<?=$Uploaded?>" />
</td>
</tr>
<tr>
<td class="label tooltip" title="Download amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end.">Downloaded:</span></td>
<td class="label tooltip" title="Download amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end.">Downloaded:</td>
<td>
<input type="hidden" name="OldDownloaded" value="<?=$Downloaded?>" />
<input type="text" size="20" name="Downloaded" value="<?=$Downloaded?>" />
@ -1077,7 +1104,7 @@ function check_paranoia_here($Setting) {
if (check_perms('users_edit_invites')) {
?>
<tr>
<td class="label tooltip" title="Number of invites">Invites:</span></td>
<td class="label tooltip" title="Number of invites">Invites:</td>
<td><input type="text" size="5" name="Invites" value="<?=$Invites?>" /></td>
</tr>
<?
@ -1086,7 +1113,7 @@ function check_paranoia_here($Setting) {
if (check_perms('admin_manage_fls') || (check_perms('users_mod') && $OwnProfile)) {
?>
<tr>
<td class="label tooltip" title="This is the message shown in the right-hand column on /staff.php">FLS/Staff remark:</span></td>
<td class="label tooltip" title="This is the message shown in the right-hand column on /staff.php">FLS/Staff remark:</td>
<td><input type="text" class="wide_input_text" name="SupportFor" value="<?=display_str($SupportFor)?>" /></td>
</tr>
<?
@ -1122,7 +1149,8 @@ function check_paranoia_here($Setting) {
</select>
</td>
</tr>
<? }
<?
}
if (check_perms('users_edit_password')) {
?>
@ -1189,7 +1217,7 @@ function check_paranoia_here($Setting) {
</tr>
<? } ?>
<tr>
<td class="label tooltip" title="This message *will* be sent to the user in the warning PM!">Warning reason:</span></td>
<td class="label tooltip" title="This message *will* be sent to the user in the warning PM!">Warning reason:</td>
<td>
<input type="text" class="wide_input_text" name="WarnReason" />
</td>
@ -1248,9 +1276,9 @@ function check_paranoia_here($Setting) {
</td>
</tr>
<? } ?>
<?
}
}
if (check_perms('users_disable_any')) {
?>
@ -1276,13 +1304,13 @@ function check_paranoia_here($Setting) {
</td>
</tr>
<tr>
<td class="label tooltip" title="Enter a comma-delimited list of forum IDs.">Restricted forums:</span></td>
<td class="label tooltip" title="Enter a comma-delimited list of forum IDs.">Restricted forums:</td>
<td>
<input type="text" class="wide_input_text" name="RestrictedForums" value="<?=display_str($RestrictedForums)?>" />
</td>
</tr>
<tr>
<td class="label tooltip" title="Enter a comma-delimited list of forum IDs.">Extra forums:</span></td>
<td class="label tooltip" title="Enter a comma-delimited list of forum IDs.">Extra forums:</td>
<td>
<input type="text" class="wide_input_text" name="PermittedForums" value="<?=display_str($PermittedForums)?>" />
</td>
@ -1306,8 +1334,9 @@ function check_paranoia_here($Setting) {
<td><input type="checkbox" name="LogOut" id="LogOut" /></td>
</tr>
</table>
<? } ?>
<? if (check_perms("users_mod")) {
<?
}
if (check_perms('users_mod')) {
DonationsView::render_mod_donations($UserID);
}
?>
@ -1318,9 +1347,9 @@ function check_paranoia_here($Setting) {
</td>
</tr>
<tr>
<td class="label tooltip" title="This message will be entered into staff notes only.">Reason:</span></td>
<td class="label tooltip" title="This message will be entered into staff notes only.">Reason:</td>
<td>
<textarea rows="1" class="wide_input_text" name="Reason" id="Reason" onkeyup="resize('Reason');"></textarea>
<textarea rows="1" cols="35" class="wide_input_text" name="Reason" id="Reason" onkeyup="resize('Reason');"></textarea>
</td>
</tr>
<tr>
@ -1337,7 +1366,8 @@ function check_paranoia_here($Setting) {
</tr>
</table>
</form>
<? }
<?
}
?>
</div>
</div>