From 0635397ab2bd5afc6789cef56b9a9d87bd52bcfd Mon Sep 17 00:00:00 2001 From: pb1dft Date: Sat, 25 Nov 2006 22:58:24 +0000 Subject: Fixed some stuff on album art added ability to sort albums on name/year in artist.php --- artists.php | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'artists.php') diff --git a/artists.php b/artists.php index 8e8a8612..b84e1ed1 100644 --- a/artists.php +++ b/artists.php @@ -41,8 +41,38 @@ switch($action) { show_box_top(); show_alphabet_list('artists','artists.php'); show_box_bottom(); + + // Setup the View Ojbect + $view = new View(); + $view->import_session_view(); + + $artist = new Artist($_REQUEST['artist']); - $artist->show_albums(); + + $sql = "SELECT DISTINCT(album.id) FROM song,album WHERE song.album=album.id AND song.artist='$artist->id'"; + + if ($_REQUEST['keep_view']) { + $view->initialize(); + } + + // If we aren't keeping the view then initlize it + elseif ($sql) { + if (!$sort_order) { $sort_order = 'album.name'; } + $db_results = mysql_query($sql, dbh()); + $total_items = mysql_num_rows($db_results); + if ($match != "Show_all") { $offset_limit = $_SESSION['userdata']['offset_limit']; } + $view = new View($sql, 'artists.php',$sort_order,$total_items,$offset_limit); + } + + else { $view = false; } + + if ($view->base_sql) { + $artist->show_albums($view->sql); + } + + + + //$artist->show_albums(); break; case 'show_all_songs': -- cgit