summaryrefslogtreecommitdiffstats
path: root/lib/class/artist.class.php
diff options
context:
space:
mode:
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;