diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-12-25 10:04:27 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-12-25 10:04:27 +0000 |
commit | 27158141ee1a14b7d23ae8997d2c41b49fc904d9 (patch) | |
tree | 2180fff67d21ffdbab32f2105cff3c7275b6b511 /lib/rating.lib.php | |
parent | 5415c2e847032896907946c98d68a254399e4416 (diff) | |
download | ampache-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 'lib/rating.lib.php')
-rw-r--r-- | lib/rating.lib.php | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/lib/rating.lib.php b/lib/rating.lib.php new file mode 100644 index 00000000..4f854c93 --- /dev/null +++ b/lib/rating.lib.php @@ -0,0 +1,82 @@ +<?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. + +*/ + +/** + * show_rating + * This takes an artist id and includes the right file + */ +function show_rating($object_id,$type) { + + $rating = new Rating($object_id,$type); + + switch (conf('ratings')) { + case 'normal': + include(conf('prefix') . '/templates/show_object_rating.inc.php'); + break; + case 'flash': + include(conf('prefix') . '/templates/show_object_rating_flash.inc.php'); + break; + default: + return false; + break; + } // end flash switch + + return true; + +} // show_rating + +/** + * get_rating_name + * This takes a score and returns the name that we should use + */ +function get_rating_name($score) { + + switch ($score) { + case '0': + return _("Don't Play"); + break; + case '1': + return _("It's Pretty Bad"); + break; + case '2': + return _("It's Ok"); + break; + case '3': + return _("It's Pretty Good"); + break; + case '4': + return _("I Love It!"); + break; + case '5': + return _("It's Insane"); + break; + // I'm fired + default: + return _("Off the Charts!"); + break; + } // end switch + + return true; + +} // get_rating_name + +?> |