diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-25 07:21:45 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-25 07:21:45 +0000 |
commit | 4040d0623dc6c88ee7119dd00244b8800c8e4684 (patch) | |
tree | 0babd4abef3d49cfd64c796a69094e53f1919775 /lib/class/playlist.class.php | |
parent | 608820577f6c5b7cf81860b8bf082285ec01e7f8 (diff) | |
download | ampache-4040d0623dc6c88ee7119dd00244b8800c8e4684.tar.gz ampache-4040d0623dc6c88ee7119dd00244b8800c8e4684.tar.bz2 ampache-4040d0623dc6c88ee7119dd00244b8800c8e4684.zip |
fixed the page reloads once and for all, had to revert to iframe for democratic play and localplay, fixed an adding issue with democratic play if the songs were left in your active playlist
Diffstat (limited to 'lib/class/playlist.class.php')
-rw-r--r-- | lib/class/playlist.class.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php index f186785f..eb74b163 100644 --- a/lib/class/playlist.class.php +++ b/lib/class/playlist.class.php @@ -146,12 +146,14 @@ class Playlist { * get_random_items * This is the same as before but we randomize the buggers! */ - public function get_random_items() { + public function get_random_items($limit='') { $results = array(); + $limit_sql = $limit ? 'LIMIT ' . intval($limit) : ''; + $sql = "SELECT `object_id`,`object_type`,`dynamic_song` FROM `playlist_data` " . - "WHERE `playlist`='" . Dba::escape($this->id) . "' ORDER BY RAND()"; + "WHERE `playlist`='" . Dba::escape($this->id) . "' ORDER BY RAND() $limit_sql"; $db_results = Dba::query($sql); while ($row = Dba::fetch_assoc($db_results)) { |