From d2f656d583b18b420849429cecdb532f94be6052 Mon Sep 17 00:00:00 2001 From: Git Date: Sat, 3 Mar 2012 08:00:28 +0000 Subject: [PATCH] Empty commit --- classes/class_user_rank.php | 9 ++++++--- sections/user/takemoderate.php | 16 ++++++++++++++-- sections/user/user.php | 30 +++++++++++++++++++++--------- static/functions/user.js | 10 ++++++++++ 4 files changed, 51 insertions(+), 14 deletions(-) diff --git a/classes/class_user_rank.php b/classes/class_user_rank.php index 0c0613b8..0997744e 100644 --- a/classes/class_user_rank.php +++ b/classes/class_user_rank.php @@ -67,10 +67,11 @@ function get_rank($TableName, $Value) { //Cache lock! $Lock = $Cache->get_value(PREFIX.$TableName."_lock"); if($Lock) { - ?>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; - } } diff --git a/sections/user/takemoderate.php b/sections/user/takemoderate.php index 0ab1b330..f5f86de4 100644 --- a/sections/user/takemoderate.php +++ b/sections/user/takemoderate.php @@ -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; } diff --git a/sections/user/user.php b/sections/user/user.php index 692fd089..6dccefe2 100644 --- a/sections/user/user.php +++ b/sections/user/user.php @@ -282,26 +282,26 @@ function check_paranoia_here($Setting) {
Percentile Rankings (Hover for values)
@@ -1116,7 +1116,19 @@ function check_paranoia_here($Setting) { Extension: - + + + + + + + + + + Reduction: + +