From: slothman Date: Fri, 15 Feb 2008 17:53:54 +0000 (+0000) Subject: Fix to word-rating code X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d66044b08a1afda5e662d61d7064196bfb257626;p=s9y.git Fix to word-rating code --- diff --git a/plugins/serendipity_event_karma/serendipity_event_karma.php b/plugins/serendipity_event_karma/serendipity_event_karma.php index 03116e7..01ed261 100644 --- a/plugins/serendipity_event_karma/serendipity_event_karma.php +++ b/plugins/serendipity_event_karma/serendipity_event_karma.php @@ -1574,14 +1574,13 @@ END_IMG_CSS; $rating = ((float)$points) / ((float)$votes); // Put it into the language-specific string format, rounding up // I'm mapping invalid cases (rating > 5 and rating < -2) to the extremes - $rating = (int)($rating + 0.5); - if ($rating <= -2) { + if ($rating <= -1.5) { $rating = PLUGIN_KARMA_VOTEPOINT_1; - } elseif ($rating <= -1) { + } elseif ($rating <= -0.5) { $rating = PLUGIN_KARMA_VOTEPOINT_2; - } elseif ($rating <= 0) { + } elseif ($rating <= 0.5) { $rating = PLUGIN_KARMA_VOTEPOINT_3; - } elseif ($rating <= 1) { + } elseif ($rating <= 1.5) { $rating = PLUGIN_KARMA_VOTEPOINT_4; } else { $rating = PLUGIN_KARMA_VOTEPOINT_5;