]> git.mjollnir.org Git - s9y.git/commitdiff
Fixes to match 1.3 word-rating change
authorslothman <slothman>
Fri, 15 Feb 2008 17:54:56 +0000 (17:54 +0000)
committerslothman <slothman>
Fri, 15 Feb 2008 17:54:56 +0000 (17:54 +0000)
plugins/serendipity_event_karma/serendipity_event_karma.php

index 03116e78cf7a53de5065d954ce31f6a2153fbac1..01ed261f1754a3fe9242bd46884cd75f763b4ec0 100644 (file)
@@ -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;