diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/header.inc | 2 | ||||
-rw-r--r-- | templates/show_object_rating.inc.php | 17 |
2 files changed, 12 insertions, 7 deletions
diff --git a/templates/header.inc b/templates/header.inc index 635330d8..d69cee63 100644 --- a/templates/header.inc +++ b/templates/header.inc @@ -45,7 +45,7 @@ $location = get_location(); </div> <div id="topbarright"> <a href="http://www.ampache.org/index.php">Ampache v.<?php echo conf('version'); ?></a><br /> - <b><?php echo _("You are currently logged in as") . " " . $GLOBALS['user']->username; ?></b> + <b><?php echo _("You are currently logged in as") . " " . $GLOBALS['user']->fullname; ?></b> <br /> <?php echo _("Browse"); ?>: <form method="post" action="<?php echo conf('web_path'); ?>/browse.php" enctype="multipart/form-data" style="Display:inline;"> 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"; |