diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-03-24 08:24:29 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-03-24 08:24:29 +0000 |
commit | feffae660e250ba631e74dea0b62088749d10b6b (patch) | |
tree | 4929350f153ec363033c9b216ad86d2fb227e147 /albums.php | |
parent | 80b0748b4a43087aed6802b6b631f064f975f097 (diff) | |
download | ampache-feffae660e250ba631e74dea0b62088749d10b6b.tar.gz ampache-feffae660e250ba631e74dea0b62088749d10b6b.tar.bz2 ampache-feffae660e250ba631e74dea0b62088749d10b6b.zip |
added a hack for some additional sorting and fixed it so that the user table has alternating colors
Diffstat (limited to 'albums.php')
-rw-r--r-- | albums.php | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -187,6 +187,22 @@ else { $sql = "SELECT id FROM album WHERE name LIKE '$match%'"; } // end switch + switch ($_REQUEST['type']) { + case 'album_sort': + if ($match != 'Browse' && $match != 'Show_missing_art' && $match != 'Show_all') { + $match_string = " AND album.name LIKE '$match%'"; + } + unset($_REQUEST['keep_view']); + $sql = "SELECT album.id, IF(COUNT(DISTINCT(song.artist)) > 1,'Various', artist.name) AS artist_name " . + "FROM song,artist,album WHERE song.album=album.id AND song.artist=artist.id $match_string" . + "GROUP BY album.name,album.year"; + $sort_order = 'artist.name'; + break; + default: + + break; + } // switch on special sort types + // if we are returning if ($_REQUEST['keep_view']) { $view->initialize(); @@ -194,10 +210,11 @@ else { // If we aren't keeping the view then initlize it elseif ($sql) { + if (!$sort_order) { $sort_order = '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, 'albums.php','name',$total_items,$offset_limit); + $view = new View($sql, 'albums.php',$sort_order,$total_items,$offset_limit); } else { $view = false; } |