summaryrefslogtreecommitdiffstats
path: root/templates/show_object_rating.inc.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-12-27 01:31:18 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-12-27 01:31:18 +0000
commit534f9da3d2b2644c2700050c76657d003878ed58 (patch)
tree87d0a6aa736ed0d6b2d398d0d9d3534ca7fecc9f /templates/show_object_rating.inc.php
parent6b0b77f12b6873204bfd73a250621115b1f539a0 (diff)
downloadampache-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.php17
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";