diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-04-08 05:58:05 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-04-08 05:58:05 +0000 |
commit | 2b55e30467f5ccdf9324b0377c419c5681f4c215 (patch) | |
tree | 16c2f63178ff762a673face6abb7fe584b680b36 /lib/ui.lib.php | |
parent | 941afedab85ffd77a83188ca09a888e0603fae72 (diff) | |
download | ampache-2b55e30467f5ccdf9324b0377c419c5681f4c215.tar.gz ampache-2b55e30467f5ccdf9324b0377c419c5681f4c215.tar.bz2 ampache-2b55e30467f5ccdf9324b0377c419c5681f4c215.zip |
This update includes a full rewrite of the Localplay code, only update
to this version if you don't care about losing a lot of functionality
while I am still finishing it up. Also the only working localplay
method is currently MPD. UPDATE AT YOUR OWN RISK!
Diffstat (limited to 'lib/ui.lib.php')
-rw-r--r-- | lib/ui.lib.php | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/lib/ui.lib.php b/lib/ui.lib.php index dec697ae..2bed47c6 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -50,32 +50,6 @@ function show_confirmation($title,$text,$next_url,$cancel=0) { } // show_confirmation /** - * set_preferences - * legacy function... - * @todo Remove References - * @deprecated - */ -function set_preferences() { - - init_preferences(); - return true; - -} // set_preferences - -/** - * get_preferences - * WTF was I thinking, this should be set or ini not get.. it doesn't get anything.. sigh anyway I'll - * leave this be for now. - * @deprecated - */ -function get_preferences($username=0) { - - init_preferences(); - return true; - -} // get_preferences - -/** * init_preferences * Third times the charm, why rename a function once when you can do it three times :( * This grabs the preferences and then loads them into conf it should be run on page load @@ -86,7 +60,7 @@ function init_preferences() { /* Get Global Preferences */ $sql = "SELECT preferences.name,user_preference.value FROM preferences,user_preference WHERE user_preference.user='-1' " . - " AND user_preference.preference = preferences.id AND preferences.type='system'"; + " AND user_preference.preference = preferences.id AND preferences.catagory='system'"; $db_results = mysql_query($sql, dbh()); while ($r = mysql_fetch_assoc($db_results)) { @@ -95,10 +69,13 @@ function init_preferences() { } // end while sys prefs /* Now we need to allow the user to override some stuff that's been set by the above */ - $username = $_SESSION['userdata']['username']; + $user_id = '-1'; + if ($GLOBALS['user']->username) { + $user_id = sql_escape($GLOBALS['user']->id); + } - $sql = "SELECT preferences.name,user_preference.value FROM preferences,user_preference WHERE user_preference.user='$username' " . - " AND user_preference.preference = preferences.id AND preferences.type != 'system'"; + $sql = "SELECT preferences.name,user_preference.value FROM preferences,user_preference WHERE user_preference.user='$user_id' " . + " AND user_preference.preference = preferences.id AND preferences.catagory != 'system'"; $db_results = mysql_query($sql, dbh()); while ($r = mysql_fetch_assoc($db_results)) { @@ -106,6 +83,11 @@ function init_preferences() { $results[$name] = $r['value']; } // end while + /* Set the Theme mojo */ + if (strlen($results['theme_name']) > 0) { + $results['theme_path'] = '/themes/' . $results['theme_name']; + } + conf($results,1); return true; @@ -444,7 +426,7 @@ function get_now_playing() { $np_user = new User($r['user']); $results[] = array('song'=>$song,'user'=>$np_user); } // end while - +/* $myMpd = init_mpd(); if (is_object($myMpd) AND conf('mpd_method') == 'file') { @@ -465,7 +447,7 @@ function get_now_playing() { } // end while } // end if we have a MPD object - +*/ return $results; |