summaryrefslogtreecommitdiffstats
path: root/lib/class/rating.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-12-23 22:35:32 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-12-23 22:35:32 +0000
commit76bdfc5b97cc2cb61866ae0126f38f397e8e4f90 (patch)
tree28ac47a042ab7cfd10a76468cea8837363522670 /lib/class/rating.class.php
parentdc609498aef42c7a28b313edf42b5d7416c8d69c (diff)
downloadampache-76bdfc5b97cc2cb61866ae0126f38f397e8e4f90.tar.gz
ampache-76bdfc5b97cc2cb61866ae0126f38f397e8e4f90.tar.bz2
ampache-76bdfc5b97cc2cb61866ae0126f38f397e8e4f90.zip
new rating class for SoundOfEmotions rating mojo
Diffstat (limited to 'lib/class/rating.class.php')
-rw-r--r--lib/class/rating.class.php86
1 files changed, 86 insertions, 0 deletions
diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php
new file mode 100644
index 00000000..6d5199a4
--- /dev/null
+++ b/lib/class/rating.class.php
@@ -0,0 +1,86 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2005 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.
+
+*/
+
+/**
+ * Rating class
+ * This is an amalgamation(sp?) of code from SoundOfEmotion
+ * to track ratings for songs, albums and artists.
+*/
+class Rating {
+
+ /* Provided vars */
+ var $id; // The ID of the object who's ratings we want to pull
+ var $type; // The type of object we want
+
+ /* Generated vars */
+ var $rating; // The rating as set by this user
+ var $average_rating; // The average rating as set by all users
+
+ /**
+ * Constructor
+ * This is run every time a new object is created, it requires
+ * the id and type of object that we need to pull the raiting for
+ */
+ function Rating($id,$type) {
+
+
+
+
+ } // Rating
+
+ /**
+ * get_user
+ * Get the user's rating this is based off the currently logged
+ * in user. It sets the $this->rating and returns the value
+ */
+ function get_user() {
+
+
+
+ } // get_user
+
+ /**
+ * get_average
+ * Get the users average rating this is based off the floor'd average
+ * of what everyone has rated this album as. This is shown if there
+ * is no personal rating, and used for random play mojo. It sets
+ * $this->average_rating and returns the value
+ */
+ function get_average() {
+
+
+ } // get_average
+
+ /**
+ * set_rating
+ * This function sets a rating for the current $this object.
+ * This uses the currently logged in user for the 'user' who is rating
+ * the object. Returns true on success, false on failure
+ */
+ function set_rating() {
+
+
+
+ } // set_rating
+
+} //end rating class
+?>