From ce1a8672d4b2d78b8301527311a410af893c4943 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Thu, 14 Dec 2006 05:13:09 +0000 Subject: * Added delete admin function on democratic play * fixed some minor display issues with playlist dropdowns * added Delete Disabled bin script for removing disabled songs --- modules/lib.php | 129 +------------------------------------------------------- 1 file changed, 2 insertions(+), 127 deletions(-) (limited to 'modules') diff --git a/modules/lib.php b/modules/lib.php index e51b8e4a..93e4c812 100644 --- a/modules/lib.php +++ b/modules/lib.php @@ -10,36 +10,6 @@ */ -/*********************************************************/ -/* Functions for getting songs given artist, album or id */ -/*********************************************************/ -// TODO : albums should be always gruoped by -// id, like 'greatest hits' album is below, never by name. -// Other catalog functions should take care of assigning all -// songs with same name album to the same album id. It should -// not be done here. -// I'm commenting all this out to always sort by ID, to -// see how bad it is. -Rubin -function get_songs_from_album ($album) { - - global $settings; - $dbh = dbh(); - - $songs = array(); - - $query = "SELECT track, id as song FROM song" . - " WHERE album = '$album'" . - " ORDER BY track, title"; - - $db_result = mysql_query($query, $dbh); - - while ( $r = mysql_fetch_array($db_result) ) { - $songs[] = $r; - } - - return $songs; -} - // Used by playlist functions when you have an array of something of type // and you want to extract the songs from it whether type is artists or albums @@ -70,39 +40,8 @@ function get_songs_from_type ($type, $results, $artist_id = 0) { return $song; } - -function show_playlist_form () { - - print << - - - - - Playlist: - - -ECHO; - - show_playlist_dropdown(); - - print << - - - - - - - - - - -ECHO; - -} - - +// This function makes baby vollmer cry, need to fix +//FIXME function get_artist_info ($artist_id) { $dbh = dbh(); @@ -220,70 +159,6 @@ function show_albums ($albums,$view=0) { } // show_albums -function get_playlist_track_from_song ( $playlist_id, $song_id ) { - - $dbh = dbh(); - - $sql = "SELECT track FROM playlist_data" . - " WHERE playlist = '$playlist_id'" . - " AND song = '$song_id'"; - $db_result = mysql_query($sql, $dbh); - if ($r = mysql_fetch_array($db_result)) { - return $r[0]; - } - else { - return FALSE; - } -} - -/** - * show_playlist_dropdown - * Hacking this for now... will fix tomorrow evening - * Hmm Vollmer Lies... it's been a lot longer then said tomorrow evening... - */ -function show_playlist_dropdown ($playlist_id=0,$no_new=false) { - - global $settings; - $dbh = dbh(); - - $userid = scrub_in($_SESSION['userdata']['username']); - $sql = "SELECT * FROM playlist" . - " WHERE user = '$userid'" . - " AND name <> 'Temporary'" . - " ORDER BY name"; - $db_result = @mysql_query($sql, $dbh); - - echo "\n"; -} - - -// Used to show when we have an access error for a playlist -function show_playlist_access_error ($playlist, $username) { - - $plname = $playlist->name; - $pluser = new User($playlist->user); - $plowner = $pluser->username; - - print << Playlist Access Error

-

$username doesn't have access to update the '$plname' playlist, it is owned by $plowner.

- -ECHO; - -} - - // Used to show a form with confirm action button on it (for deleting playlists, users, etc) /*! @function show_confirm_action -- cgit