diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-23 08:00:34 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-23 08:00:34 +0000 |
commit | f283e4040e0dea301c94278470515ca6472af8c2 (patch) | |
tree | 72ddc03245026420fe128c5cd149fa9fa8103d80 /lib | |
parent | 2faea5f7b345ba0d9319d4466261b52c7bff0325 (diff) | |
download | ampache-f283e4040e0dea301c94278470515ca6472af8c2.tar.gz ampache-f283e4040e0dea301c94278470515ca6472af8c2.tar.bz2 ampache-f283e4040e0dea301c94278470515ca6472af8c2.zip |
few more tweaks and some work on the tv pages
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/tmp_playlist.class.php | 14 | ||||
-rw-r--r-- | lib/preferences.php | 3 | ||||
-rw-r--r-- | lib/ui.lib.php | 48 |
3 files changed, 18 insertions, 47 deletions
diff --git a/lib/class/tmp_playlist.class.php b/lib/class/tmp_playlist.class.php index 2bf4cd4a..8829c41e 100644 --- a/lib/class/tmp_playlist.class.php +++ b/lib/class/tmp_playlist.class.php @@ -191,6 +191,20 @@ class tmpPlaylist { } // has_vote /** + * vote_active + * This checks to see if this playlist is a voting playlist + * and if it is active + */ + function vote_active() { + + /* Going to do a little more here later */ + if ($this->type == 'vote') { return true; } + + return false; + + } // vote_active + + /** * delete_track * This deletes a track and any assoicated votes, we only check for * votes if it's a -1 session diff --git a/lib/preferences.php b/lib/preferences.php index bf995e4c..8bd01020 100644 --- a/lib/preferences.php +++ b/lib/preferences.php @@ -264,6 +264,7 @@ function create_preference_input($name,$value) { case 'play_type': if ($value == 'downsample') { $is_down = 'selected="selected"'; } elseif ($value == 'localplay') { $is_local = 'selected="selected"'; } + elseif ($value == 'democratic') { $is_vote = 'selected="selected"'; } else { $is_stream = "selected=\"selected\""; } echo "<select name=\"$name\">\n"; echo "\t<option value=\"\">" . _('None') . "</option>\n"; @@ -274,7 +275,7 @@ function create_preference_input($name,$value) { echo "\t<option value=\"downsample\" $is_down>" . _('Downsample') . "</option>\n"; } if (conf('allow_democratic_playback')) { - echo "\t<option value=\"democratic\" $is_demo>" . _('Democratic') . "</option>\n"; + echo "\t<option value=\"democratic\" $is_vote>" . _('Democratic') . "</option>\n"; } if (conf('allow_localplay_playback')) { echo "\t<option value=\"localplay\" $is_local>" . _('Localplay') . "</option>\n"; diff --git a/lib/ui.lib.php b/lib/ui.lib.php index f4f5e3bd..9fdd2cdb 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -76,7 +76,7 @@ function flip_class($array=0) { */ function clear_now_playing() { - $sql = "DELETE FROM now_playing"; + $sql = "TRUNCATE TABLE now_playing"; $db_results = mysql_query($sql, dbh()); return true; @@ -84,31 +84,6 @@ function clear_now_playing() { } // clear_now_playing /** - * show_menu_items - * shows menu items - */ -function show_menu_items ($high) { - - include(conf('prefix') . "/templates/menu.inc"); - -} // show_menu_items - -/** - * Show Browse Menu - * Shows the menu used by the browse page - * @package Web Interface - * @cataogry Menu - * @author Karl Vollmer - */ -function show_browse_menu($highlight) { - - $highlight = ucfirst($highlight); - - include(conf('prefix'). "/templates/show_browse_menu.inc"); - -} // show_browse_menu - -/** * _ * checks to see if the alias _ is defined * if it isn't it defines it as a simple return @@ -1355,30 +1330,11 @@ function xml_from_array($array,$callback=0) { } // end foreach elements if (!$callback) { - $string = "<root>\n" . $string . "</root>\n"; + $string = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<root>\n" . $string . "</root>\n"; } return $string; } // xml_from_array -/** - * show_ajax_js - * This displays the javascript array definition needed - * For ajax to know what it should be replacing - */ -function show_ajax_js($name,$array) { - - $elements = count($array); - - echo "<script type=\"text/javascript\" language=\"javascript\">\n"; - echo "<!--\n"; - echo "var $name = new Array($elements);\n"; - foreach ($array as $key=>$value) { - echo $name . "[$key] = \"$value\";\n"; - } - echo "-->\n</script>\n"; - -} // show_ajax_js - ?> |