diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-05-13 18:38:19 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-05-13 18:38:19 +0000 |
commit | 1a6ae62569dbc5603a361a488641950cc317ac3d (patch) | |
tree | 130afc63e183c49559572e0ccf93f5cdcd89d7cf /lib/album.lib.php | |
parent | dccdeba838129a5a3805c7669ec0a6328269f738 (diff) | |
download | ampache-1a6ae62569dbc5603a361a488641950cc317ac3d.tar.gz ampache-1a6ae62569dbc5603a361a488641950cc317ac3d.tar.bz2 ampache-1a6ae62569dbc5603a361a488641950cc317ac3d.zip |
flushed out the album view and added a few more features removed unused icons
Diffstat (limited to 'lib/album.lib.php')
-rw-r--r-- | lib/album.lib.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/album.lib.php b/lib/album.lib.php index 410b189b..ceb6cdf2 100644 --- a/lib/album.lib.php +++ b/lib/album.lib.php @@ -1,8 +1,6 @@ <?php /* - This library handles album related functions.... wooo! - //FIXME: Remove this in favor of /modules/class/album */ /*! @@ -71,7 +69,7 @@ function get_random_albums($count='') { $count = Dba::escape($count); // We avoid a table scan by using the id index and then using a rand to pick a row # - $sql = "SELECT `id` FROM `album` WHERE `art` IS NOT NULL"; + $sql = "SELECT `id` FROM `album`"; $db_results = Dba::query($sql); while ($r = Dba::fetch_assoc($db_results)) { @@ -82,9 +80,12 @@ function get_random_albums($count='') { for ($i=0; $i <= $count; $i++) { $record = rand(0,$total); - $results[] = $albums[$record]; - } - + if (isset($results[$record]) || !$albums[$record]) { $i--; } + else { + $results[$record] = $albums[$record]; + } + } // end for + return $results; } // get_random_albums |