diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-12-27 01:31:18 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-12-27 01:31:18 +0000 |
commit | 534f9da3d2b2644c2700050c76657d003878ed58 (patch) | |
tree | 87d0a6aa736ed0d6b2d398d0d9d3534ca7fecc9f /templates/show_object_rating.inc.php | |
parent | 6b0b77f12b6873204bfd73a250621115b1f539a0 (diff) | |
download | ampache-534f9da3d2b2644c2700050c76657d003878ed58.tar.gz ampache-534f9da3d2b2644c2700050c76657d003878ed58.tar.bz2 ampache-534f9da3d2b2644c2700050c76657d003878ed58.zip |
fixed rating system if using non-flash
Diffstat (limited to 'templates/show_object_rating.inc.php')
-rw-r--r-- | templates/show_object_rating.inc.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/templates/show_object_rating.inc.php b/templates/show_object_rating.inc.php index 5b95868b..91df1f15 100644 --- a/templates/show_object_rating.inc.php +++ b/templates/show_object_rating.inc.php @@ -29,19 +29,24 @@ if ($type != 'song') { $base_url = conf('web_path') . '/ratings.php?action=set_rating&mode=' . conf('flash') . '&rating_type=' . $rating->type . '&object_id=' . $rating->id . '&username=' . $GLOBALS['user']->username; $score = '0'; + /* count up to 6 */ while ($score < 6) { /* Handle the "Not rated" possibility */ - if ($score == '0' AND $score === $rating->rating) { + if ($score == '0' AND $rating->rating == '-1') { echo "<img src=\"" . conf('web_path') . "/images/ratings/x.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\">\n"; + $found_on = true; } - elseif ($score == '0') { - echo "<a href=\"" . $base_url . "&rating=$score\">\n"; - echo "\t<img src=\"" . conf('web_path') . "/images/ratings/x_off.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\">\n"; - echo "</a>"; + elseif ($score == '0' AND $rating->rating == '0') { + echo "<img src=\"" . conf('web_path') . "/images/ratings/x_off.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\">\n"; + $found_on = true; } - elseif ($score === $rating->rating) { + elseif ($score == $rating->rating) { echo "<img src=\"" . conf('web_path') . "/images/ratings/star.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\">\n"; + $found_on = true; + } + elseif (!$found_on) { + echo "<a href=\"" . $base_url . "&rating=$score\">\n\t<img src=\"" . conf('web_path') . "/images/ratings/star.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\">\n</a>\n"; } else { echo "<a href=\"" . $base_url . "&rating=$score\">\n\t<img src=\"" . conf('web_path') . "/images/ratings/star_off.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\">\n</a>\n"; |