summaryrefslogtreecommitdiffstats
path: root/lib/class/artist.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-07 07:20:01 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-07 07:20:01 +0000
commitaf2ff07a8174ac2796fa45337bcc5c70d870e0b1 (patch)
tree9ebaecb008ef72d3b07cc1984de6e8249a13719a /lib/class/artist.class.php
parent96334a0e8c1c59077e6f9c067dbdee14f6b07be7 (diff)
downloadampache-af2ff07a8174ac2796fa45337bcc5c70d870e0b1.tar.gz
ampache-af2ff07a8174ac2796fa45337bcc5c70d870e0b1.tar.bz2
ampache-af2ff07a8174ac2796fa45337bcc5c70d870e0b1.zip
- Fixed Ratings
- Tweaked RSS, still needs work - Show Single artist mostly finished
Diffstat (limited to 'lib/class/artist.class.php')
-rw-r--r--lib/class/artist.class.php39
1 files changed, 11 insertions, 28 deletions
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index 7a07785d..7de2f62d 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -71,20 +71,21 @@ class Artist {
} // _get_info
- /*!
- @function get_albums
- @discussion gets the albums for this artist
- //FIXME: Appears to not be used?
- */
- function get_albums($sql) {
+ /**
+ * get_albums
+ * gets the album ids that this artist is a part
+ * of
+ */
+ public function get_albums() {
$results = array();
-// $sql = "SELECT DISTINCT(album.id) FROM song,album WHERE song.album=album.id AND song.artist='$this->id' ORDER BY album.name";
- $db_results = mysql_query($sql, dbh());
+ $sql = "SELECT `album`.`id` FROM album LEFT JOIN `song` ON `song`.`album`=`album`.`id` " .
+ "WHERE `song`.`artist`='$this->id' GROUP BY `album`.`id` ORDER BY `album`.`name`,`album`.`year`";
+ $db_results = Dba::query($sql);
- while ($r = mysql_fetch_object($db_results)) {
- $results[] = new Album($r->id);
+ while ($r = Dba::fetch_assoc($db_results)) {
+ $results[] = $r['id'];
}
return $results;
@@ -287,24 +288,6 @@ class Artist {
}
} // merge
-
- /*!
- @function show_albums
- @discussion displays the show albums by artist page
- */
- function show_albums($sql = 0) {
-
- /* Set Vars */
- $web_path = conf('web_path');
-
- $albums = $this->get_albums($sql);
- $this->format_artist();
- $artist = $this;
-
- require (conf('prefix') . "/templates/show_artist.inc");
-
- } // show_albums
-
/*!
@function get_similar_artists
@discussion returns an array of artist (id,name) arrays that are similar in name