diff options
author | nf <nf@ampache> | 2007-07-14 11:36:37 +0000 |
---|---|---|
committer | nf <nf@ampache> | 2007-07-14 11:36:37 +0000 |
commit | 538e79b2666daa4eb0bb9bb6f83ae0186ac089ea (patch) | |
tree | 0109c1efd5c40c3b61f5ca16a5cbba967fc7359a /templates/show_object_rating_static.inc.php | |
parent | 6a929af1bf1953b74471220e22df22321b71630d (diff) | |
download | ampache-538e79b2666daa4eb0bb9bb6f83ae0186ac089ea.tar.gz ampache-538e79b2666daa4eb0bb9bb6f83ae0186ac089ea.tar.bz2 ampache-538e79b2666daa4eb0bb9bb6f83ae0186ac089ea.zip |
Added classes to show_localplay_status.inc and updated all themes for compatibility.
Added show_object_rating_static.inc (supplied by andy90) and modified rating.lib for this to work
Removed obsolete patches from cleandy themes.
Fixed a tiny css bug in StoneBlue theme.
Fixed horizontal menu in Burgundy theme (explicit height in #sidebar li)
Diffstat (limited to 'templates/show_object_rating_static.inc.php')
-rw-r--r-- | templates/show_object_rating_static.inc.php | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/templates/show_object_rating_static.inc.php b/templates/show_object_rating_static.inc.php new file mode 100644 index 00000000..47c7d57e --- /dev/null +++ b/templates/show_object_rating_static.inc.php @@ -0,0 +1,64 @@ +<?php +/* + Copyright 2001 - 2007 Ampache.org + All Rights Reserved + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +/* Create some variables we are going to need */ +$web_path = conf('web_path'); +$base_url = conf('ajax_url') . '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id . conf('ajax_info'); + + +//set the background to no stars +echo "<ul class=\"star-rating\">\n"; + +/* Handle the "Not rated" possibility */ +if ($rating->rating == '-1') { + echo "<li class=\"zero-stars\"></li>\n"; +} +else { + echo "<li class=\"zero-stars\"></li>\n"; +} +// decide width of rating. image is 16 px wide +$width = $rating->rating*16; +if ($width < 0) $width = 0; + +//set the current rating background +echo "<li class=\"current-rating\" style=\"width:${width}px\" >Current rating: "; +if ($rating->rating <= 0) { + echo "not rated yet </li>\n"; +} +else echo "$rating->rating of 5</li>\n"; + +//it did not like my "1-star", "2-star" ... css styles, and I changed it to this after I realized star1... would have worked :\ +?> +<li> + <span class="one-stars" title="1 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="two-stars" title="2 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="three-stars" title="3 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="four-stars" title="4 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="five-stars" title="5 <?php echo _('out of'); ?> 5"></span> +</li> +</ul>
\ No newline at end of file |