diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-12 02:52:50 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-12 02:52:50 +0000 |
commit | 693e26e2ad074f8cc9d37098a0568cd93ae30f52 (patch) | |
tree | 8588523335a337d0971df768da0456e325bb6b66 /lib/class/album.class.php | |
parent | 003619c52c0370f03b9edb466addaaebac13ce41 (diff) | |
download | ampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.tar.gz ampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.tar.bz2 ampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.zip |
commit of the patches from codeoverload to implement tagging, will not work without manual modification of database, yes.. this commit breaks things cope
Diffstat (limited to 'lib/class/album.class.php')
-rw-r--r-- | lib/class/album.class.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php index 5c810ca6..eef95831 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -90,14 +90,25 @@ class Album { return $album; } // construct_from_array - + public static function build_cache($ids, $fields='*') { + $idlist = '(' . implode(',', $ids) . ')'; + $sql = "SELECT $fields FROM album WHERE id in $idlist"; + $db_results = Dba::query($sql); + global $album_cache; + $album_cache = array(); + while ($results = Dba::fetch_assoc($db_results)) { + $album_cache[intval($results['id'])] = $results; + } + } /** * _get_info * This is a private function that pulls the album * from the database */ private function _get_info() { - + global $album_cache; + if (isset($album_cache[intval($this->id)])) + return $album_cache[intval($this->id)]; // Just get the album information $sql = "SELECT * FROM `album` WHERE `id`='" . $this->id . "'"; $db_results = Dba::query($sql); |