Index: www/format/format.php
===================================================================
--- www/format/format.php	(revision 1171)
+++ www/format/format.php	(working copy)
@@ -146,7 +146,8 @@
     if (is_null($rating)) {
         $attr = array();
     } else {
-        $attr = array('class' => 'user_'.rating_group($rating));
+        $rating_group = rating_group($rating);
+        $attr = array('class' => 'user_'.$rating_group["group"]);
     }
 
     $rbadge = format_user_ratingbadge($user_name, $rating);
@@ -198,29 +199,33 @@
     return $result;
 }
 
-// Return rating group based on user's absolute rating.
-// Rating groups (from highest to lowest ranking): 1, 2, 3, 0
+// Return rating group and colour based on user's sclaed rating scale.
+// Rating groups (from highest to lowest ranking): 1, 2, 3, 4, 0
 // NOTE: It outputs 0 when user is not rated
-function rating_group($absolute_rating, $is_admin = false) {
+function rating_group($rating, $is_admin = false) {
     if ($is_admin) {
-        // all mighty admin
-        return 4;
+        // all mighty admin - black
+        return array("group" => 5, "colour" => "#000000");
     }
-    if (!$absolute_rating) {
-        return 0;
+    if (!$rating) {
+        // user unrated - white
+        return array("group" => 0, "colour" => "#ffffff");
     }
-    $rating = rating_scale($absolute_rating);
-    if ($rating < 520) {
+    if ($rating < 540) {
         // green
-        return 3;
+        return array("group" => 4, "colour" => "#00a900");
     }
     else if ($rating < 600) {
+        // blue
+        return array("group" => 3, "colour" => "#0000ff");
+    }
+    else if ($rating < 700) {
         // yellow
-        return 2;
+        return array("group" => 2, "colour" => "#ddcc00");
     }
     else {
         // red
-        return 1;
+        return array("group" => 1, "colour" => "#ee0000");
     }
 }
 
@@ -229,8 +234,9 @@
 function format_user_ratingbadge($username, $rating) {
     if ($rating) {
         $is_admin = user_is_admin(user_get_by_username($username));
-        $class = rating_group($rating, $is_admin);
         $rating = rating_scale($rating);
+        $rating_group = rating_group($rating, $is_admin);
+        $class = $rating_group["group"];
         $att = array(
             'title' => 'Rating '.html_escape($username).': '.$rating,
             'class' => 'rating-badge-'.$class,
Index: www/macros/macro_tasks.php
===================================================================
--- www/macros/macro_tasks.php	(revision 1171)
+++ www/macros/macro_tasks.php	(working copy)
@@ -154,7 +154,7 @@
         $filter_user_id = null;
     } else {
         $user_id = identity_get_user_id();
-        $filter_username = request('user', identity_get_user());
+        $filter_username = request('user', identity_get_username());
         $filter_user = user_get_by_username($filter_username);
         if ($filter_user != null) {
             $filter_user_id = $filter_user['id'];
Index: www/static/css/sitewide.css
===================================================================
--- www/static/css/sitewide.css	(revision 1171)
+++ www/static/css/sitewide.css	(working copy)
@@ -180,33 +180,40 @@
 /* color-coded user ratings */
 /* put some extra work to override SMF CSS */
 a.rating-badge-1, a.rating-badge-2, a.rating-badge-3, a.rating-badge-4,
-a.rating-badge-1:link, a.rating-badge-2:link, a.rating-badge-3:link, a.rating-badge-4:link {
+a.rating-badge-5,
+a.rating-badge-1:link, a.rating-badge-2:link, a.rating-badge-3:link,
+a.rating-badge-4:link, a.rating-badge-5:link {
     font-size: 12pt;
     font-weight: normal;
     padding: 0 0 0 .1em;
     margin: .1em .1em .1em 0;
     border: 1px solid white;
 }
-a.rating-badge-1:hover, a.rating-badge-2:hover, a.rating-badge-3:hover, a.rating-badge-4:hover {
+a.rating-badge-1:hover, a.rating-badge-2:hover, a.rating-badge-3:hover,
+a.rating-badge-4:hover, a.rating-badge-5:hover {
     border: 1px solid gray;
     text-decoration: none;
 }
-a.rating-badge-4:link, a.rating-badge-4:visited { color: #ffa000; }
-a.rating-badge-3:link, a.rating-badge-3:visited { color: #00a900; }
+a.rating-badge-5:link, a.rating-badge-5:visited { color: #000000; }
+a.rating-badge-4:link, a.rating-badge-4:visited { color: #00a900; }
+a.rating-badge-3:link, a.rating-badge-3:visited { color: #0000ff; }
 a.rating-badge-2:link, a.rating-badge-2:visited { color: #ddcc00; }
 a.rating-badge-1:link, a.rating-badge-1:visited { color: #ee0000; }
-a.rating-badge-4:hover { border-color: #ffa000; }
-a.rating-badge-3:hover { border-color: #00a900; }
+a.rating-badge-5:hover { border-color: #000000; }
+a.rating-badge-4:hover { border-color: #00a900; }
+a.rating-badge-3:hover { border-color: #0000ff; }
 a.rating-badge-2:hover { border-color: #ddcc00; }
 a.rating-badge-1:hover { border-color: #ee0000; }
-#header a.rating-badge-1, #header a.rating-badge-2, #header a.rating-badge-3, #header a.rating-badge-4 {
+#header a.rating-badge-1, #header a.rating-badge-2, #header a.rating-badge-3,
+#header a.rating-badge-4, #header a.rating-badge-5 {
     padding-right: .1em;
     margin-right: .1em;
     border: 0;
     font-size: 12pt;
 }
-#header a.rating-badge-4 { color: #ffa000; }
-#header a.rating-badge-3 { color: #00a900; }
+#header a.rating-badge-5 { color: #000000; }
+#header a.rating-badge-4 { color: #00a900; }
+#header a.rating-badge-3 { color: #0000ff; }
 #header a.rating-badge-2 { color: #ddcc00; }
 #header a.rating-badge-1 { color: #ee0000; }
 
Index: www/views/plot_distribution.php
===================================================================
--- www/views/plot_distribution.php	(revision 1171)
+++ www/views/plot_distribution.php	(working copy)
@@ -1,5 +1,6 @@
 <?php
 
+require_once(IA_ROOT_DIR."www/format/format.php");
 require_once(IA_ROOT_DIR."www/php-ofc-library/open-flash-chart.php");
 
 // create the rating chart
@@ -70,14 +71,8 @@
         ($current_rating + rating_scale($bucket_size) - 1)
         . "<br>" . $count . ($count == 1 ? " concurent" : " concurenti"));
 
-    if (rating_scale($bucket * $bucket_size) < 520) {
-        $bar_value->set_colour("#00a900");
-    } elseif (rating_scale($bucket * $bucket_size) < 600) {
-        $bar_value->set_colour("#ddcc00");
-    } else {
-        $bar_value->set_colour("ee0000");
-    }
-
+    $rating_group = rating_group(rating_scale($bucket * $bucket_size));
+    $bar_value->set_colour($rating_group["colour"]);
     $bar->append_value($bar_value);
     ++$p;
 }
Index: www/views/plot_rating.php
===================================================================
--- www/views/plot_rating.php	(revision 1171)
+++ www/views/plot_rating.php	(working copy)
@@ -1,5 +1,6 @@
 <?php
 
+require_once(IA_ROOT_DIR."www/format/format.php");
 require_once(IA_ROOT_DIR."www/php-ofc-library/open-flash-chart.php");
 
 // get data ranges
@@ -74,14 +75,8 @@
     }
 
     $current_y = rating_scale($round['rating']);
-    if ($current_y < 520) {
-        $colour = "#00a900";
-    } elseif ($current_y < 600) {
-        $colour = "#ddcc00";
-    } else {
-        $colour = "#ee0000";
-    }
-    $dot = new dot_value($current_y, $colour);
+    $rating_group = rating_group($current_y);
+    $dot = new dot_value($current_y, $rating_group["colour"]);
     if ($current_y == $peak_point) {
         $dot->set_tooltip("Max: #val#<br>" . $round['round_title']);
     } else {
