Empty commit

This commit is contained in:
Git 2012-03-03 08:00:28 +00:00
parent 9346f4d074
commit d2f656d583
4 changed files with 51 additions and 14 deletions

View File

@ -67,10 +67,11 @@ function get_rank($TableName, $Value) {
//Cache lock!
$Lock = $Cache->get_value(PREFIX.$TableName."_lock");
if($Lock) {
?><script type="script/javascript">setTimeout('window.location="http://<?=NONSSL_SITE_URL?><?=$_SERVER['REQUEST_URI']?>"', 5)</script><?
return false;
} else {
$Cache->cache_value(PREFIX.$TableName."_lock", '1', 10);
$Cache->cache_value(PREFIX.$TableName."_lock", '1', 300);
$Table = $this->build_table(PREFIX.$TableName, $this->table_query($TableName));
$Cache->delete_value(PREFIX.$TableName."_lock");
}
}
$LastPercentile = 0;
@ -88,6 +89,9 @@ function overall_score($Uploaded, $Downloaded, $Uploads, $Requests, $Posts, $Bou
// We can do this all in 1 line, but it's easier to read this way
if($Ratio>1) { $Ratio = 1; }
$TotalScore = 0;
if(in_array(false, func_get_args(), true)) {
return false;
}
$TotalScore += $Uploaded*15;
$TotalScore += $Downloaded*8;
$TotalScore += $Uploads*25;
@ -98,7 +102,6 @@ function overall_score($Uploaded, $Downloaded, $Uploads, $Requests, $Posts, $Bou
$TotalScore /= (15+8+25+2+1+1+1);
$TotalScore *= $Ratio;
return $TotalScore;
}
}

View File

@ -50,6 +50,7 @@
$WarnLength = (int)$_POST['WarnLength'];
$ExtendWarning = (int)$_POST['ExtendWarning'];
$ReduceWarning = (int)$_POST['ReduceWarning'];
$WarnReason = $_POST['WarnReason'];
$UserReason = $_POST['UserReason'];
$DisableAvatar = (isset($_POST['DisableAvatar']))? 1 : 0;
@ -351,11 +352,22 @@
send_pm($UserID,0,db_string('Your warning has been extended'),db_string("Your warning has been extended by $ExtendWarning week(s) by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason"));
$UpdateSet[]="Warned=Warned + INTERVAL $ExtendWarning WEEK";
$Msg = "warning extended by $ExtendWarning week(s)";
$DB->query("SELECT Warned + INTERVAL $ExtendWarning WEEK FROM users_info WHERE UserID='$UserID'");
list($WarnedUntil) = $DB->next_record();
$Msg = "warning extended by $ExtendWarning week(s) to $WarnedUntil";
if ($WarnReason) { $Msg.=" for $WarnReason"; }
$EditSummary[]= db_string($Msg);
$DB->query("SELECT Warned FROM users_info WHERE UserID='$UserID'");
$LightUpdates['Warned']=$WarnedUntil;
} elseif ($Warned == 1 && $ExtendWarning=='---' && $ReduceWarning!='---' && check_perms('users_warn')) {
send_pm($UserID,0,db_string('Your warning has been reduced'),db_string("Your warning has been reduced by $ReduceWarning week(s) by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason"));
$UpdateSet[]="Warned=Warned - INTERVAL $ReduceWarning WEEK";
$DB->query("SELECT Warned - INTERVAL $ReduceWarning WEEK FROM users_info WHERE UserID='$UserID'");
list($WarnedUntil) = $DB->next_record();
$Msg = "warning reduced by $ReduceWarning week(s) to $WarnedUntil";
if ($WarnReason) { $Msg.=" for $WarnReason"; }
$EditSummary[]= db_string($Msg);
$LightUpdates['Warned']=$WarnedUntil;
}

View File

@ -282,26 +282,26 @@ function check_paranoia_here($Setting) {
<div class="head colhead_dark">Percentile Rankings (Hover for values)</div>
<ul class="stats nobullet">
<? if (check_paranoia_here('uploaded')) { ?>
<li title="<?=get_size($Uploaded)?>">Data uploaded: <?=number_format($UploadedRank)?></li>
<li title="<?=get_size($Uploaded)?>">Data uploaded: <?=$UploadedRank === false ? 'Server busy' : number_format($UploadedRank)?></li>
<? } ?>
<? if (check_paranoia_here('downloaded')) { ?>
<li title="<?=get_size($Downloaded)?>">Data downloaded: <?=number_format($DownloadedRank)?></li>
<li title="<?=get_size($Downloaded)?>">Data downloaded: <?=$DownloadedRank === false ? 'Server busy' : number_format($DownloadedRank)?></li>
<? } ?>
<? if (check_paranoia_here('uploads+')) { ?>
<li title="<?=$Uploads?>">Torrents uploaded: <?=number_format($UploadsRank)?></li>
<li title="<?=$Uploads?>">Torrents uploaded: <?=$UploadsRank === false ? 'Server busy' : number_format($UploadsRank)?></li>
<? } ?>
<? if (check_paranoia_here('requestsfilled_count')) { ?>
<li title="<?=$RequestsFilled?>">Requests filled: <?=number_format($RequestRank)?></li>
<li title="<?=$RequestsFilled?>">Requests filled: <?=$RequestRank === false ? 'Server busy' : number_format($RequestRank)?></li>
<? } ?>
<? if (check_paranoia_here('requestsvoted_bounty')) { ?>
<li title="<?=get_size($TotalSpent)?>">Bounty spent: <?=number_format($BountyRank)?></li>
<li title="<?=get_size($TotalSpent)?>">Bounty spent: <?=$BountyRank === false ? 'Server busy' : number_format($BountyRank)?></li>
<? } ?>
<li title="<?=$ForumPosts?>">Posts made: <?=number_format($PostRank)?></li>
<li title="<?=$ForumPosts?>">Posts made: <?=$PostRank === false ? 'Server busy' : number_format($PostRank)?></li>
<? if (check_paranoia_here('artistsadded')) { ?>
<li title="<?=$ArtistsAdded?>">Artists added: <?=number_format($ArtistsRank)?></li>
<li title="<?=$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: <?=number_format($OverallRank)?></strong></li>
<li><strong>Overall rank: <?=$OverallRank === false ? 'Server busy' : number_format($OverallRank)?></strong></li>
<? } ?>
</ul>
</div>
@ -1116,7 +1116,19 @@ function check_paranoia_here($Setting) {
<tr>
<td class="label">Extension:</td>
<td>
<select name="ExtendWarning">
<select name="ExtendWarning" onChange="ToggleWarningAdjust(this)">
<option>---</option>
<option value="1"> 1 Week</option>
<option value="2"> 2 Weeks</option>
<option value="4"> 4 Weeks</option>
<option value="8"> 8 Weeks</option>
</select>
</td>
</tr>
<tr id="ReduceWarningTR">
<td class="label">Reduction:</td>
<td>
<select name="ReduceWarning"ReduceWarning">
<option>---</option>
<option value="1"> 1 Week</option>
<option value="2"> 2 Weeks</option>

View File

@ -135,3 +135,13 @@ function ParanoiaResetOn() {
}
addDOMLoadEvent(AlterParanoia);
function ToggleWarningAdjust(selector) {
if (selector.options[selector.selectedIndex].value == '---') {
$('#ReduceWarningTR').show();
$('#ReduceWarning').raw().disabled = false;
} else {
$('#ReduceWarningTR').hide();
$('#ReduceWarning').raw().disabled = true;
}
}