diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-04-09 07:55:50 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-04-09 07:55:50 +0000 |
commit | 5aeac3b17e31d0cc88321a614469c4f3f1a9c0dc (patch) | |
tree | ff7ceb1767ce45ab9dc9e5e192ed36bc69e3db90 /lib/localplay.lib.php | |
parent | 79a890b7bf7bd9b31e6879c64d5651cef02975f3 (diff) | |
download | ampache-5aeac3b17e31d0cc88321a614469c4f3f1a9c0dc.tar.gz ampache-5aeac3b17e31d0cc88321a614469c4f3f1a9c0dc.tar.bz2 ampache-5aeac3b17e31d0cc88321a614469c4f3f1a9c0dc.zip |
added an ugly localplay view page, and made it so you can remove songs from your mpd playlist... its ugly.. I know.. ooh yea you can also deactivate modules now
Diffstat (limited to 'lib/localplay.lib.php')
-rw-r--r-- | lib/localplay.lib.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/localplay.lib.php b/lib/localplay.lib.php index c4a0976a..2aa42772 100644 --- a/lib/localplay.lib.php +++ b/lib/localplay.lib.php @@ -100,8 +100,38 @@ function insert_localplay_preferences($type) { */ function remove_localplay_preferences($type=0) { + /* If we've gotten a type wipe and go! */ + if ($type) { + $sql = "DELETE FROM preferences WHERE name LIKE 'localplay_" . sql_escape($type) . "_%'"; + $db_results = mysql_query($sql, dbh()); + return true; + } + + + /* Select everything but our two built-in ones + $sql = "SELECT * FROM preferences WHERE name != 'localplay_level' AND name != 'localplay_controller' AND name LIKE 'localplay_%'"; + $db_results = mysql_query($sql, dbh()); + + $results = array(); + /* We need to organize by module to make it easy + * to figure out which modules no longer exist + * and wack the preferences... unless we've + * specified a name then just wack those + * preferences + */ + while ($r = mysql_fetch_assoc($db_results)) { + + $name = $r['name']; + preg_match("/localplay_([\w\d\-\]+)_.+/",$name,$matches); + $key = $matches['1']; + + $results[$key] = $r; + + } // end while + /* If we've got a type */ + //FIXME!!! } // remove_localplay_preferences |