summaryrefslogtreecommitdiffstats
path: root/lib/class/browse.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-29 16:49:44 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-29 16:49:44 +0000
commit20b425c3ac56d24068f56cfa455e07d5fa26f13d (patch)
tree460a7b1a78886d85c1decb6cf92664f726504ba9 /lib/class/browse.class.php
parente00b5875aba6e3bad68096c59cb3641dbfb6dc4f (diff)
downloadampache-20b425c3ac56d24068f56cfa455e07d5fa26f13d.tar.gz
ampache-20b425c3ac56d24068f56cfa455e07d5fa26f13d.tar.bz2
ampache-20b425c3ac56d24068f56cfa455e07d5fa26f13d.zip
fixed song retaging, fixed the song view page tweaked sidebar browse and fixed a bug where sorting then viewing a object that could not be sorted by said type caused nothing to display
Diffstat (limited to 'lib/class/browse.class.php')
-rw-r--r--lib/class/browse.class.php44
1 files changed, 30 insertions, 14 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php
index e86b6786..375afe8a 100644
--- a/lib/class/browse.class.php
+++ b/lib/class/browse.class.php
@@ -300,21 +300,37 @@ class Browse {
if ($order != 'DESC') { $order == 'ASC'; }
- if ($_SESSION['browse']['type'] == 'song') {
- switch($field) {
- case 'title';
- $sql = "`song`.`title`";
- break;
- case 'year':
- $sql = "`song`.`year`";
- break;
- default:
- // Rien a faire
- break;
- } // end switch
- } // end if song
+ switch ($_SESSION['browse']['type']) {
+ case 'song':
+ switch($field) {
+ case 'title';
+ $sql = "`song`.`title`";
+ break;
+ case 'year':
+ $sql = "`song`.`year`";
+ break;
+ default:
+ // Rien a faire
+ break;
+ } // end switch
+ break;
+ case 'album':
+ switch($field) {
+ case 'name':
+ $sql = "`album`.`name`";
+ break;
+ case 'year':
+ $sql = "`album`.`year`";
+ break;
+ } // end switch
+ default:
+ // Rien a faire
+ break;
+ } // end switch
- return "$sql $order,";
+ if ($sql) { $sql_sort = "$sql $order,"; }
+
+ return $sql_sort;
} // sql_sort