From ff606dbefca94580b56a081c5d3089037a2d033d Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Sun, 22 Jul 2007 18:32:09 +0000 Subject: removed some old/legacy functions fixed download and merged it into the /play --- lib/ui.lib.php | 237 +++------------------------------------------------------ 1 file changed, 10 insertions(+), 227 deletions(-) (limited to 'lib/ui.lib.php') diff --git a/lib/ui.lib.php b/lib/ui.lib.php index d7aaa0aa..7ae9e4ec 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -69,18 +69,6 @@ function flip_class($array=0) { } // flip_class -/** - * clear_now_playing - * Clears the now playing information incase something has - * gotten stuck in there - */ -function clear_now_playing() { - - $sql = "TRUNCATE TABLE `now_playing`"; - $db_results = Dba::query($sql); - -} // clear_now_playing - /** * _ * checks to see if the alias _ is defined @@ -94,14 +82,6 @@ if (!function_exists('_')) { } // if _ isn't defined -/** - * show_admin_menu - * shows the admin menu - */ -function show_admin_menu ($admin_highlight) { - include(conf('prefix') . "/templates/admin_menu.inc"); -} // show_admin_menu - /** * access_denied * throws an error if they try to do something @@ -187,21 +167,6 @@ function show_local_control () { } // show_local_control -/** - * truncate_with_ellipse - * truncates a text file to specified length by adding - * thre dots (ellipse) to the end - * (Thx Nedko Arnaudov) - * @todo Fix Spelling! - * @depreciated - */ -function truncate_with_ellipse($text, $max=27) { - - /* Run the function with the correct spelling */ - return truncate_with_ellipsis($text,$max); - -} // truncate_with_ellipse - /** * truncate_with_ellipsis * Correct Spelling function that truncates text to a specific lenght @@ -327,8 +292,7 @@ function get_now_playing($filter='') { * if they don't: insert them * */ - -function set_artist_rating($artist_id, $rate_user, $rating) { +function set_artist_rating ($artist_id, $rate_user, $rating) { $artist_id = sql_escape($artist_id); $sql = "SELECT * FROM ratings WHERE user='$rate_user' AND object_type='artist' AND object_id='$artist_id'"; @@ -646,84 +610,6 @@ function show_genre($genre_id) { } // show_genre -function show_random_play_bar() { - - require (conf('prefix') . '/templates/show_random_play_bar.inc.php'); - -} // show_random_play_bar() - - -/* - * show_artist_pulldown() - * - * Helper functions for album and artist functions - * - */ -function show_artist_pulldown ($artist_id,$select_name='artist') { - - $sq = "SELECT `id`,`name` FROM `artist` ORDER BY `name`"; - $db_results = Dba::query($sq); - - echo "\n\n"; - -} // show_artist_pulldown - -/** - * show_catalog_pulldown - * This has been changed, first is the name of the - * dropdown select, the second is the style to be applied - * - */ -function show_catalog_pulldown ($name='catalog',$style) { - - $sql = "SELECT `id`,`name` FROM `catalog` ORDER BY `name`"; - $db_result = Dba::query($sql); - - echo "\n\n"; - -} // show_catalog_pulldown - - -/** - * show_submenu - * This shows the submenu mojo for the sidebar, and I guess honestly anything - * else you would want it to... takes an array of items which have ['url'] ['title'] - * and ['active'] - */ -function show_submenu($items) { - - require Config::get('prefix') . '/templates/subnavbar.inc.php'; - -} // show_submenu - - /** * get_location * This function gets the information about said persons currently location @@ -840,49 +726,6 @@ function show_preference_box($preferences) { } // show_preference_box - -/** - * show_genre_pulldown - * This shows a select of all of the genres, it takes the name of the select - * the currently selected and then the size - * - */ -function show_genre_pulldown ($name,$selected='',$size=1,$width=0,$style='') { - - /* Get them genre hippies */ - $sql = "SELECT genre.id,genre.name FROM genre ORDER BY genre.name"; - $db_result = Dba::query($sql); - - if ($size > 0) { - $multiple_txt = "multiple=\"multiple\" size=\"$size\""; - } - if ($style) { - $style_txt = "style=\"$style\""; - } - - echo "\n"; - -} // show_genre_pulldown - /** * good_email * Don't get me started... I'm sure the indenting is still wrong on this @@ -1023,24 +866,6 @@ function show_playlist_import() { } // show_playlist_import -/** - * show_songs - * Still not happy with this function, but at least it's in the right - * place now - */ -function show_songs ($song_ids, $playlist, $album=0) { - - $dbh = dbh(); - - $totaltime = 0; - $totalsize = 0; - - require (conf('prefix') . "/templates/show_songs.inc"); - - return true; - -} // show_songs - /** * show_album_select * This displays a select of every album that we've got in Ampache, (it can be hella long) it's used @@ -1050,10 +875,10 @@ function show_album_select($name='album',$album_id=0) { echo "\n"; - $sql = "SELECT id, name, prefix FROM artist ORDER BY name"; - $db_results = mysql_query($sql, dbh()); + $sql = "SELECT `id`, `name`, `prefix` FROM `artist` ORDER BY `name`"; + $db_results = Dba::query($sql); - while ($r = mysql_fetch_assoc($db_results)) { + while ($r = Dba::fetch_assoc($db_results)) { $selected = ''; $artist_name = trim($r['prefix'] . " " . $r['name']); if ($r['id'] == $artist_id) { @@ -1103,10 +928,10 @@ function show_genre_select($name='genre',$genre_id=0) { echo "