diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-24 10:19:06 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-24 10:19:06 +0000 |
commit | 8f78e6885bbbb977af00ce54c74fa2006e384e9a (patch) | |
tree | f32bedca137f9a36019b6e68912f9001de1bc8fe /lib/class/browse.class.php | |
parent | 7a4d5df34f6391a7f94023112fbeb0bba330ffa5 (diff) | |
download | ampache-8f78e6885bbbb977af00ce54c74fa2006e384e9a.tar.gz ampache-8f78e6885bbbb977af00ce54c74fa2006e384e9a.tar.bz2 ampache-8f78e6885bbbb977af00ce54c74fa2006e384e9a.zip |
fixed some browsing stuff that I broke a while back
Diffstat (limited to 'lib/class/browse.class.php')
-rw-r--r-- | lib/class/browse.class.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index fed25419..cad974ed 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -135,6 +135,7 @@ class Browse { */ public static function set_sort($sort,$order='') { + switch ($_SESSION['browse']['type']) { case 'song': $valid_array = array('title','year','track','time'); @@ -162,6 +163,7 @@ class Browse { } if ($order) { + $order = ($order == 'DESC') ? 'DESC' : 'ASC'; $_SESSION['browse']['sort'] = array(); $_SESSION['browse']['sort'][$sort] = $order; } @@ -175,7 +177,7 @@ class Browse { $_SESSION['browse']['sort'] = array(); $_SESSION['browse']['sort'][$sort] = 'DESC'; } - + self::resort_objects(); } // set_sort @@ -442,7 +444,7 @@ class Browse { case 'album': switch($field) { case 'name': - $sql = "`album`.`name`, `album`.`disk`"; + $sql = "`album`.`name`"; break; case 'year': $sql = "`album`.`year`"; @@ -517,7 +519,9 @@ class Browse { // Format any matches we have so we can show them to the masses $match = $_SESSION['browse']['filter']['alpha_match'] ? ' (' . $_SESSION['browse']['filter']['alpha_match'] . ')' : ''; - $class = "box browse_".$_SESSION['browse']['type']; + // Set the correct classes based on type + $class = "box browse_".$_SESSION['browse']['type']; + switch ($_SESSION['browse']['type']) { case 'song': show_box_top(_('Songs') . $match, $class); @@ -610,8 +614,8 @@ class Browse { // Clean her up $order_sql = rtrim($order_sql,"ORDER BY "); $order_sql = rtrim($order_sql,","); - $sql = $sql . $order_sql; + $db_results = Dba::query($sql); while ($row = Dba::fetch_assoc($db_results)) { |