From 00d74cac5a20c26017554b5e6eaef624b48f886e Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Tue, 31 Oct 2006 06:55:54 +0000 Subject: fixed something I thought I had already fixed, and fiddled with democratic play a tiny bit --- lib/class/tmp_playlist.class.php | 2 +- lib/democratic.lib.php | 44 ++++++++++++++++++++++++++++++++++++++++ lib/localplay.lib.php | 4 ++-- 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 lib/democratic.lib.php (limited to 'lib') diff --git a/lib/class/tmp_playlist.class.php b/lib/class/tmp_playlist.class.php index acd78329..0e52aac9 100644 --- a/lib/class/tmp_playlist.class.php +++ b/lib/class/tmp_playlist.class.php @@ -114,7 +114,7 @@ class tmpPlaylist { $id = mysql_insert_id(dbh()); - /* Clean any other playlists assoicated with this sessoin */ + /* Clean any other playlists assoicated with this session */ $this->delete($sessid,$id); return $id; diff --git a/lib/democratic.lib.php b/lib/democratic.lib.php new file mode 100644 index 00000000..f027a5dc --- /dev/null +++ b/lib/democratic.lib.php @@ -0,0 +1,44 @@ +id based on our cheating + * use of the -1 session value. We still pass a value just + * incase we want to support multiple 'voting' queues later + * in life + */ +function get_democratic_playlist($session_id) { + + $session_id = sql_escape($session_id); + + $sql = "SELECT id FROM tmp_playlist WHERE session='$session_id'"; + $db_results = mysql_query($sql, dbh()); + + $results = mysql_fetch_assoc($db_results); + + $tmp_playlist = new tmpPlaylist($results['id']); + + return $tmp_playlist; + +} //get_democratic_playlist + +?> diff --git a/lib/localplay.lib.php b/lib/localplay.lib.php index bd73853b..72807e91 100644 --- a/lib/localplay.lib.php +++ b/lib/localplay.lib.php @@ -141,7 +141,7 @@ function remove_localplay_preferences($type=0) { * This returns an array of the localplay controllers filenames * as well as a 'semi-cleaned' name */ -function get_localplay_controllers() { +function get_localplay_controllers($disabled='') { /* First get a list of the files */ $handle = opendir(conf('prefix') . '/modules/localplay'); @@ -161,7 +161,7 @@ function get_localplay_controllers() { /* Get the base name, then get everything before .controller.php */ $filename = basename($file,'.controller.php'); /* Make sure that it's currently enabled */ - if (verify_localplay_preferences($filename)) { + if (verify_localplay_preferences($filename) || $disabled) { $results[] = $filename; } } -- cgit