summaryrefslogtreecommitdiffstats
path: root/lib/class/artist.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-04 08:11:01 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-04 08:11:01 +0000
commit4e9823cd1064cc876b449752b933c89c367d84c6 (patch)
treec21f0f5c9d77176caefe5701c20afbd9d610409f /lib/class/artist.class.php
parentc917726df7e3d327e3bc3030bb0b7f63925d0b42 (diff)
downloadampache-4e9823cd1064cc876b449752b933c89c367d84c6.tar.gz
ampache-4e9823cd1064cc876b449752b933c89c367d84c6.tar.bz2
ampache-4e9823cd1064cc876b449752b933c89c367d84c6.zip
fixed mysql5 crap, thx WarrenG cleaned up some of the show_songs code and stuff that calls it, did a little work on playlists
Diffstat (limited to 'lib/class/artist.class.php')
-rw-r--r--lib/class/artist.class.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index 961b5991..173fe884 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -67,7 +67,7 @@ class Artist {
function get_info() {
/* Grab the basic information from the catalog and return it */
- $sql = "SELECT * FROM artist WHERE id='$this->id'";
+ $sql = "SELECT * FROM artist WHERE id='" . sql_escape($this->id) . "'";
$db_results = mysql_query($sql, dbh());
$results = mysql_fetch_object($db_results);
@@ -112,6 +112,24 @@ class Artist {
} // get_songs
+ /**
+ * get_song_ids
+ * This gets an array of song ids that are assoicated with this artist. This is great for using
+ * with the show_songs function
+ */
+ function get_song_ids() {
+
+ $sql = "SELECT id FROM song WHERE artist='" . sql_escape($this->id) . "' ORDER BY album, track";
+ $db_results = mysql_query($sql, dbh());
+
+ while ($r = mysql_fetch_assoc($db_results)) {
+ $results[] = $r['id'];
+ }
+
+ return $results;
+
+ } // get_song_ids
+
/*!
@function get_random_songs
@discussion gets a random number, and
@@ -265,7 +283,6 @@ class Artist {
/* Set Vars */
$web_path = conf('web_path');
-
$albums = $this->get_albums();
$this->format_artist();
$artist = $this;