summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-04-23 07:51:12 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-04-23 07:51:12 +0000
commit45250f50194cac99fde9569d8e8fd54ad89db179 (patch)
treed28b841587f77bdf3f61c16a08d5e7c1559280b8 /lib
parent37607a70f493921c93a50f7d245568a9e8d34d63 (diff)
downloadampache-45250f50194cac99fde9569d8e8fd54ad89db179.tar.gz
ampache-45250f50194cac99fde9569d8e8fd54ad89db179.tar.bz2
ampache-45250f50194cac99fde9569d8e8fd54ad89db179.zip
added favorite X play links
Diffstat (limited to 'lib')
-rw-r--r--lib/class/album.class.php18
-rw-r--r--lib/class/artist.class.php26
2 files changed, 22 insertions, 22 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index 29dc9ee2..5e44af8b 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -93,20 +93,20 @@ class Album {
} // _get_info
- /*!
- @function get_songs
- @discussion gets the songs for this album
- */
- function get_songs($limit = 0) {
+ /**
+ * get_songs
+ * gets the songs for this album
+ */
+ public function get_songs($limit = 0) {
$results = array();
- $sql = "SELECT id FROM song WHERE album='$this->id' ORDER BY track, title";
+ $sql = "SELECT `id` FROM `song` WHERE `album`='$this->id' ORDER BY `track`, `title`";
if ($limit) { $sql .= " LIMIT $limit"; }
- $db_results = mysql_query($sql, dbh());
+ $db_results = Dba::query($sql);
- while ($r = mysql_fetch_object($db_results)) {
- $results[] = new Song($r->id);
+ while ($r = Dba::fetch_assoc($db_results)) {
+ $results[] = $r['id'];
}
return $results;
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index 18fa31cf..0de280c0 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -25,11 +25,11 @@
class Artist {
/* Variables from DB */
- var $id;
- var $name;
- var $songs;
- var $albums;
- var $prefix;
+ public $id;
+ public $name;
+ public $songs;
+ public $albums;
+ public $prefix;
/**
* Artist
@@ -91,17 +91,17 @@ class Artist {
} // get_albums
- /*!
- @function get_songs
- @discussion gets the songs for this artist
- */
+ /**
+ * get_songs
+ * gets the songs for this artist
+ */
function get_songs() {
- $sql = "SELECT song.id FROM song WHERE song.artist='" . sql_escape($this->id) . "'";
- $db_results = mysql_query($sql, dbh());
+ $sql = "SELECT `song`.`id` FROM `song` WHERE `song`.`artist`='" . Dba::escape($this->id) . "'";
+ $db_results = Dba::query($sql);
- while ($r = mysql_fetch_assoc($db_results)) {
- $results[] = new Song($r['id']);
+ while ($r = Dba::fetch_assoc($db_results)) {
+ $results[] = $r['id'];
}
return $results;