diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-11 08:24:05 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-11 08:24:05 +0000 |
commit | 05c406e1f751ece06a7d54bc636275837f9f0169 (patch) | |
tree | 4bb73b8d560c1ad0d0ff6c14f2607251280ce79b /lib/song.php | |
parent | 689517e332c874ac09bb41398602622a1fc36af8 (diff) | |
download | ampache-05c406e1f751ece06a7d54bc636275837f9f0169.tar.gz ampache-05c406e1f751ece06a7d54bc636275837f9f0169.tar.bz2 ampache-05c406e1f751ece06a7d54bc636275837f9f0169.zip |
added in user profile, did a little work on the preferences and session, something is fishy with session and tmp_playlist stuff will look into it tomorrow
Diffstat (limited to 'lib/song.php')
-rw-r--r-- | lib/song.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/song.php b/lib/song.php index 5a26d183..fc987943 100644 --- a/lib/song.php +++ b/lib/song.php @@ -82,11 +82,15 @@ function get_songs_from_type($type,$results,$artist_id='') { * This function returns the last X songs that have been played * It uses the 'popular' threshold to determine how many to pull */ -function get_recently_played() { +function get_recently_played($user_id='') { + + if ($user_id) { + $user_limit = " AND object_count.user='" . Dba::escape($user_id) . "'"; + } $sql = "SELECT object_count.object_id, object_count.user, object_count.object_type, object_count.date " . "FROM object_count " . - "WHERE object_type='song' " . + "WHERE object_type='song'$user_limit " . "ORDER by object_count.date DESC " . "LIMIT " . Config::get('popular_threshold'); $db_results = Dba::query($sql); |