summaryrefslogtreecommitdiffstats
path: root/templates/show_object_rating.inc.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-12-25 10:04:27 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-12-25 10:04:27 +0000
commit27158141ee1a14b7d23ae8997d2c41b49fc904d9 (patch)
tree2180fff67d21ffdbab32f2105cff3c7275b6b511 /templates/show_object_rating.inc.php
parent5415c2e847032896907946c98d68a254399e4416 (diff)
downloadampache-27158141ee1a14b7d23ae8997d2c41b49fc904d9.tar.gz
ampache-27158141ee1a14b7d23ae8997d2c41b49fc904d9.tar.bz2
ampache-27158141ee1a14b7d23ae8997d2c41b49fc904d9.zip
initial ratings mojo, some stylesheet fixes, changed user preferences again and a db update
Diffstat (limited to 'templates/show_object_rating.inc.php')
-rw-r--r--templates/show_object_rating.inc.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/templates/show_object_rating.inc.php b/templates/show_object_rating.inc.php
new file mode 100644
index 00000000..5b95868b
--- /dev/null
+++ b/templates/show_object_rating.inc.php
@@ -0,0 +1,53 @@
+<?php
+/*
+
+ Copyright 2001 - 2006 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
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ 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.
+
+*/
+
+
+if ($type != 'song') {
+ echo "<strong>" . _("Rating") . ":</strong>";
+}
+
+/* Create some variables we are going to need */
+$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) {
+ echo "<img src=\"" . conf('web_path') . "/images/ratings/x.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\">\n";
+ }
+ 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 === $rating->rating) {
+ echo "<img src=\"" . conf('web_path') . "/images/ratings/star.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\">\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";
+ }
+ /* Next! */
+ $score++;
+} // end while
+
+?>