diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-04-23 20:33:57 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-04-23 20:33:57 +0000 |
commit | 13dd43450a56bd72067b6f2350f5d188c5c7e254 (patch) | |
tree | b2bc0d26b1f7f904a15322413a044035aeca0d0f /lib/class/rating.class.php | |
parent | a12f1083e30ae16ded9dc7aa464015ad07413632 (diff) | |
download | ampache-13dd43450a56bd72067b6f2350f5d188c5c7e254.tar.gz ampache-13dd43450a56bd72067b6f2350f5d188c5c7e254.tar.bz2 ampache-13dd43450a56bd72067b6f2350f5d188c5c7e254.zip |
fixed up part of single album view, show songs is all gone, working on replacement browse method
Diffstat (limited to 'lib/class/rating.class.php')
-rw-r--r-- | lib/class/rating.class.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php index 32a85253..43200f90 100644 --- a/lib/class/rating.class.php +++ b/lib/class/rating.class.php @@ -41,7 +41,7 @@ class Rating { function Rating($id,$type) { $this->id = intval($id); - $this->type = sql_escape($type); + $this->type = Dba::escape($type); // Check for the users rating if ($rating = $this->get_user($GLOBALS['user']->id)) { @@ -62,12 +62,12 @@ class Rating { */ function get_user($user_id) { - $user_id = sql_escape($user_id); + $user_id = Dba::escape($user_id); $sql = "SELECT rating FROM ratings WHERE user='$user_id' AND object_id='$this->id' AND object_type='$this->type'"; - $db_results = mysql_query($sql, dbh()); + $db_results = Dba::query($sql); - $results = mysql_fetch_assoc($db_results); + $results = Dba::fetch_assoc($db_results); return $results['rating']; @@ -83,11 +83,11 @@ class Rating { function get_average() { $sql = "SELECT user_rating as rating FROM ratings WHERE object_id='$this->id' AND object_type='$this->type'"; - $db_results = mysql_query($sql, dbh()); + $db_results = Dba::query($sql); $i = 0; - while ($r = mysql_fetch_assoc($db_results)) { + while ($r = Dba::fetch_assoc($db_results)) { $i++; $total += $r['rating']; } // while we're pulling results |