summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-06 14:23:45 +0300
committerAndrew Dolgov <[email protected]>2018-12-06 14:23:45 +0300
commitd2d2cb7e7dd25f8257f467806da6843aca95a9cb (patch)
treebe4d7dd19ea010b70d191d338fa23e6492a222e1 /include
parentb09a58a5705bba7e987bae0601c298be2e3d5b84 (diff)
rework scoring display, JS processing and icons
Diffstat (limited to 'include')
-rwxr-xr-xinclude/functions.php26
1 files changed, 20 insertions, 6 deletions
diff --git a/include/functions.php b/include/functions.php
index 1ff18c8bb..e4e43cea8 100755
--- a/include/functions.php
+++ b/include/functions.php
@@ -1963,17 +1963,31 @@
}
function get_score_pic($score) {
- if ($score > 100) {
- return "score_high.png";
+ if ($score > 500) {
+ return "trending_up";
} else if ($score > 0) {
- return "score_half_high.png";
+ return "trending_up";
+ } else if ($score < 0) {
+ return "trending_down";
+ } else {
+ return "trending_neutral";
+ }
+ }
+
+ function get_score_class($score) {
+ if ($score > 500) {
+ $score_class = "score-high";
+ } else if ($score > 0) {
+ $score_class = "score-half-high";
} else if ($score < -100) {
- return "score_low.png";
+ $score_class = "score-low";
} else if ($score < 0) {
- return "score_half_low.png";
+ $score_class = "score-half-low";
} else {
- return "score_neutral.png";
+ $score_class = "score-neutral";
}
+
+ return $score_class;
}
function init_plugins() {