summaryrefslogtreecommitdiffstats
path: root/templates/show_object_rating_static.inc.php
diff options
context:
space:
mode:
authorspocky <spocky@ampache>2007-08-17 01:33:53 +0000
committerspocky <spocky@ampache>2007-08-17 01:33:53 +0000
commit9a3f9011f7f31dcb25c4643a625e5cba77bf9101 (patch)
tree4edaa87fcf982cc84a1f7e89cb84f7328a880f5c /templates/show_object_rating_static.inc.php
parentce094e4d95762791de7fa32b0a83ab0da7254d70 (diff)
downloadampache-9a3f9011f7f31dcb25c4643a625e5cba77bf9101.tar.gz
ampache-9a3f9011f7f31dcb25c4643a625e5cba77bf9101.tar.bz2
ampache-9a3f9011f7f31dcb25c4643a625e5cba77bf9101.zip
- updated star-rating to integrate original author's improvments (better compatibility, php code no more dependent on the stars image size which means themers can now use any image size they like)
- updated random albums css so that it does not break lines when cover is not downloaded quickly enough
Diffstat (limited to 'templates/show_object_rating_static.inc.php')
-rw-r--r--templates/show_object_rating_static.inc.php19
1 files changed, 6 insertions, 13 deletions
diff --git a/templates/show_object_rating_static.inc.php b/templates/show_object_rating_static.inc.php
index a0b60206..763c115a 100644
--- a/templates/show_object_rating_static.inc.php
+++ b/templates/show_object_rating_static.inc.php
@@ -22,23 +22,15 @@
$web_path = Config::get('web_path');
$base_url = Config::get('ajax_url') . '?action=set_rating&amp;rating_type=' . $rating->type . '&amp;object_id=' . $rating->id;
+echo "<div class=\"star-rating\">\n";
+echo "<ul>\n";
-//set the background to no stars
-echo "<ul class=\"static-star-rating\">\n";
-
-/* Handle the "Not rated" possibility */
-if ($rating->rating == '-1') {
- echo "<li class=\"zero-stars\" style=\"display:none;\">reset</li>\n";
-}
-else {
- echo "<li class=\"zero-stars\" style=\"display:none;\">reset</li>\n";
-}
-// decide width of rating. image is 16 px wide
-$width = $rating->rating*16;
+// decide width of rating (5 stars -> 20% per star)
+$width = $rating->rating*20;
if ($width < 0) $width = 0;
//set the current rating background
-echo "<li class=\"current-rating\" style=\"width:${width}px\" >Current rating: ";
+echo "<li class=\"current-rating\" style=\"width:${width}%\" >Current rating: ";
if ($rating->rating <= 0) {
echo "not rated yet </li>\n";
}
@@ -62,3 +54,4 @@ else echo "$rating->rating of 5</li>\n";
<span class="five-stars" title="5 <?php echo _('out of'); ?> 5">5</span>
</li>
</ul>
+</div>