diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-31 06:55:54 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-31 06:55:54 +0000 |
commit | 00d74cac5a20c26017554b5e6eaef624b48f886e (patch) | |
tree | cfbe1dbf2d9759f9ebbe899728dbe199827b520e /lib | |
parent | 49c1cefcb9a2dc3f81d868655e64d2e357750f9d (diff) | |
download | ampache-00d74cac5a20c26017554b5e6eaef624b48f886e.tar.gz ampache-00d74cac5a20c26017554b5e6eaef624b48f886e.tar.bz2 ampache-00d74cac5a20c26017554b5e6eaef624b48f886e.zip |
fixed something I thought I had already fixed, and fiddled with democratic play a tiny bit
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/tmp_playlist.class.php | 2 | ||||
-rw-r--r-- | lib/democratic.lib.php | 44 | ||||
-rw-r--r-- | lib/localplay.lib.php | 4 |
3 files changed, 47 insertions, 3 deletions
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 @@ +<?php +/* + + Copyright (c) 2001 - 2006 Ampache.org + All Rights Reserved + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +/** + * get_democratic_playlist + * This retrives the tmpPlaylist->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; } } |