2
/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
2
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
7
5
* LICENSE: GNU General Public License, version 2 (GPLv2)
8
* Copyright (c) 2001 - 2011 Ampache.org All Rights Reserved
6
* Copyright 2001 - 2013 Ampache.org
10
8
* This program is free software; you can redistribute it and/or
11
9
* modify it under the terms of the GNU General Public License v2
20
18
* along with this program; if not, write to the Free Software
21
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
* @copyright 2001 - 2011 Ampache.org
25
* @license http://opensource.org/licenses/gpl-2.0 GPLv2
26
* @link http://www.ampache.org/
29
23
/* Create some variables we are going to need */
30
24
$web_path = Config::get('web_path');
31
25
$base_url = '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id;
27
$rate = $rating->get_user_rating();
29
$rate = $rating->get_average_rating();
34
<div class="star-rating dynamic-star-rating">
34
<div class="star-rating dynamic-star-rating<?php if ($othering) { echo ' global-star-rating'; } ?>">
37
37
// decide width of rating (5 stars -> 20% per star)
38
$width = $rating->preciserating*20;
39
39
if ($width < 0) $width = 0;
41
41
//set the current rating background
42
echo "<li class=\"current-rating\" style=\"width:${width}%\" >" . T_('Current rating: ');
43
if ($rating->rating <= 0) {
44
echo T_('not rated yet') . "</li>\n";
42
echo '<li class="current-rating" style="width:' . $width . '%" >';
43
echo T_('Current rating: ');
45
echo T_('not rated yet') . "</li>\n";
46
else printf(T_('%s of 5'), $rating->preciserating); echo "</li>\n";
47
else printf(T_('%s of 5'), $rate); echo "</li>\n";
48
for ($i=1; $i<6; $i++)
49
for ($i = 1; $i < 6; $i++)
52
<?php echo Ajax::text($base_url . '&rating='.$i,'','rating'.$i.'_' . $rating->id,'','star'.$i); ?>
53
<?php echo Ajax::text($base_url . '&rating=' . $i, '', 'rating' . $i . '_' . $rating->id, '', 'star' . $i); ?>
58
<?php echo Ajax::text($base_url . '&rating=-1','','rating0_' . $rating->id,'','star0'); ?>
59
<?php echo Ajax::text($base_url . '&rating=-1', '', 'rating0_' . $rating->id, '', 'star0'); ?>