Skip to content

Commit 11bb281

Browse files
committed
Revert "Fix bug with max/min reputation"
This reverts commit a09051d.
1 parent 51ac2b7 commit 11bb281

1 file changed

Lines changed: 8 additions & 17 deletions

File tree

root/includes/functions_reputation.php

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,7 @@ function give_point($to, $post_id = 0, $comment, $notify = false, $point, $mode
312312
$db->sql_query($sql);
313313

314314
///Check max/min points
315-
if ($config['rs_max_point'] || $config['rs_min_point'])
316-
{
317-
$this->check_point($to);
318-
}
315+
$this->check_point($to);
319316

320317
//If config allows and we are told so, we should send a private message to a user, who received the vote
321318
if ($notify && $config['rs_pm_notify'])
@@ -384,6 +381,11 @@ private function check_point($user_id)
384381
{
385382
global $config, $db;
386383

384+
if (!$config['rs_max_point'] || !$config['rs_min_point'])
385+
{
386+
return;
387+
}
388+
387389
$sql = 'SELECT SUM(point) AS points
388390
FROM ' . REPUTATIONS_TABLE . "
389391
WHERE action != 5
@@ -400,7 +402,6 @@ private function check_point($user_id)
400402
WHERE user_id = $user_id";
401403
$db->sql_query($sql);
402404
}
403-
404405
//Min user reputation
405406
if ($config['rs_min_point'] && ($config['rs_min_point'] > $points['points']))
406407
{
@@ -459,13 +460,8 @@ function delete($id)
459460
WHERE user_id = {$row['rep_to']}";
460461
$db->sql_query($sql);
461462

462-
global $config;
463-
464463
//Check max/min points
465-
if ($config['rs_max_point'] || $config['rs_min_point'])
466-
{
467-
$this->check_point($row['rep_to']);
468-
}
464+
$this->check_point($row['rep_to']);
469465
}
470466

471467
//Update new status field
@@ -530,13 +526,8 @@ function clear_reputation($mode, $id, $post_ids = array())
530526
WHERE user_id = {$point['rep_to']}";
531527
$db->sql_query($sql);
532528

533-
global $config;
534-
535529
//Check max/min points
536-
if ($config['rs_max_point'] || $config['rs_min_point'])
537-
{
538-
$this->check_point($point['rep_to']);
539-
}
530+
$this->check_point($point['rep_to']);
540531
}
541532

542533
$sql = 'SELECT topic_id, forum_id, post_subject

0 commit comments

Comments
 (0)