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/album.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/album.class.php')
-rw-r--r-- | lib/class/album.class.php | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php index 5e44af8b..72abfab4 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -97,11 +97,15 @@ class Album { * get_songs * gets the songs for this album */ - public function get_songs($limit = 0) { + public function get_songs($limit = 0,$artist='') { $results = array(); + + if ($artist) { + $artist_sql = "AND `artist`='" . Dba::escape($artist) . "'"; + } - $sql = "SELECT `id` FROM `song` WHERE `album`='$this->id' ORDER BY `track`, `title`"; + $sql = "SELECT `id` FROM `song` WHERE `album`='$this->id' $artist_sql ORDER BY `track`, `title`"; if ($limit) { $sql .= " LIMIT $limit"; } $db_results = Dba::query($sql); @@ -114,31 +118,6 @@ class Album { } // get_songs /** - * get_song_ids - * This returns an array of the song id's that are on this album. This is used by the - * show_songs function and can be pased and artist if you so desire to limit it to that - */ - function get_song_ids($artist='') { - - /* If they pass an artist then constrain it based on the artist as well */ - if ($artist) { - $artist_sql = " AND artist='" . sql_escape($artist) . "'"; - } - - $sql = "SELECT id FROM song WHERE album='" . sql_escape($this->id) . "' $artist_sql ORDER BY track"; - $db_results = mysql_query($sql, dbh()); - - $results = array(); - - while ($r = mysql_fetch_assoc($db_results)) { - $results[] = $r['id']; - } - - return $results; - - } // get_song_ids - - /** * format * This is the format function for this object. It sets cleaned up * albumĀ information with the base required |