From d2d2cb7e7dd25f8257f467806da6843aca95a9cb Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 6 Dec 2018 14:23:45 +0300 Subject: rework scoring display, JS processing and icons --- include/functions.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'include') 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() { -- cgit v1.2.3