From 05c406e1f751ece06a7d54bc636275837f9f0169 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Mon, 11 Jun 2007 08:24:05 +0000 Subject: 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 --- lib/song.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/song.php') 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); -- cgit