summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/class/browse.class.php12
-rw-r--r--templates/show_albums.inc.php4
-rw-r--r--templates/show_artists.inc.php2
-rw-r--r--templates/show_genres.inc.php2
-rw-r--r--templates/show_live_streams.inc.php6
-rw-r--r--templates/show_playlists.inc.php2
-rw-r--r--templates/show_songs.inc.php6
7 files changed, 19 insertions, 15 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)) {
diff --git a/templates/show_albums.inc.php b/templates/show_albums.inc.php
index 962739ce..3c7b316e 100644
--- a/templates/show_albums.inc.php
+++ b/templates/show_albums.inc.php
@@ -60,10 +60,10 @@ $ajax_url = Config::get('ajax_url');
<?php if (Browse::get_filter('show_art')) { ?>
<th class="cel_cover"><?php echo _('Cover'); ?></th>
<?php } ?>
- <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&sort=name',_('Album'),'album_sort_name'); ?></th>
+ <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&sort=name',_('Album'),'album_sort_name_bottom'); ?></th>
<th class="cel_artist"><?php echo _('Artist'); ?></th>
<th class="cel_songs"><?php echo _('Songs'); ?></th>
- <th class="cel_year"><?php echo Ajax::text('?page=browse&action=set_sort&sort=year',_('Year'),'album_sort_year'); ?></th>
+ <th class="cel_year"><?php echo Ajax::text('?page=browse&action=set_sort&sort=year',_('Year'),'album_sort_year_bottom'); ?></th>
<th class="cel_action"><?php echo _('Actions'); ?></th>
</tr>
</table>
diff --git a/templates/show_artists.inc.php b/templates/show_artists.inc.php
index 954686aa..f2bbe8fa 100644
--- a/templates/show_artists.inc.php
+++ b/templates/show_artists.inc.php
@@ -49,7 +49,7 @@ foreach ($object_ids as $artist_id) {
<?php } //end foreach ($artists as $artist) ?>
<tr class="th-bottom">
<th class="cel_add"><?php echo _('Add'); ?></th>
- <th class="cel_artist"><?php echo Ajax::text('?page=browse&action=set_sort&sort=name',_('Artist'),'artist_sort_name'); ?></th>
+ <th class="cel_artist"><?php echo Ajax::text('?page=browse&action=set_sort&sort=name',_('Artist'),'artist_sort_name_bottom'); ?></th>
<th class="cel_songs"> <?php echo _('Songs'); ?> </th>
<th class="cel_albums"> <?php echo _('Albums'); ?> </th>
<th class="cel_action"> <?php echo _('Action'); ?> </th>
diff --git a/templates/show_genres.inc.php b/templates/show_genres.inc.php
index d2df78ba..1e60c8ba 100644
--- a/templates/show_genres.inc.php
+++ b/templates/show_genres.inc.php
@@ -65,7 +65,7 @@ foreach ($object_ids as $genre_id) {
<?php } // end foreach genres ?>
<tr class="th-bottom">
<th class="cel_add"><?php echo _('Add'); ?></th>
- <th class="cel_genre"><?php echo Ajax::text('?page=browse&action=set_sort&sort=name',_('Genre'),'sort_genre_name'); ?></th>
+ <th class="cel_genre"><?php echo Ajax::text('?page=browse&action=set_sort&sort=name',_('Genre'),'sort_genre_name_bottom'); ?></th>
<th class="cel_songs"><?php echo _('Songs'); ?></th>
<th class="cel_action"><?php echo _('Action'); ?></th>
</tr>
diff --git a/templates/show_live_streams.inc.php b/templates/show_live_streams.inc.php
index b315922c..631ee177 100644
--- a/templates/show_live_streams.inc.php
+++ b/templates/show_live_streams.inc.php
@@ -50,9 +50,9 @@ foreach ($object_ids as $radio_id) {
<?php } //end foreach ($artists as $artist) ?>
<tr class="th-bottom">
<th class="cel_add"><?php echo _('Add'); ?></th>
- <th class="cel_streamname"><?php echo Ajax::text('?page=browse&action=set_sort&sort=name',_('Name'),'live_stream_sort_name'); ?></th>
- <th class="cel_callsign"><?php echo Ajax::text('?page=browse&action=set_sort&sort=call_sign',_('Callsign'),'live_stream_call_sign'); ?></th>
- <th class="cel_frequency"><?php echo Ajax::text('?page=browse&action=set_sort&sort=frequency',_('Frequency'),'live_stream_frequency'); ?></th>
+ <th class="cel_streamname"><?php echo Ajax::text('?page=browse&action=set_sort&sort=name',_('Name'),'live_stream_sort_name_bottom'); ?></th>
+ <th class="cel_callsign"><?php echo Ajax::text('?page=browse&action=set_sort&sort=call_sign',_('Callsign'),'live_stream_call_sign_bottom'); ?></th>
+ <th class="cel_frequency"><?php echo Ajax::text('?page=browse&action=set_sort&sort=frequency',_('Frequency'),'live_stream_frequency_bottom'); ?></th>
<th class="cel_genre"><?php echo _('Genre'); ?></th>
<th class="cel_action"><?php echo _('Action'); ?> </th>
</tr>
diff --git a/templates/show_playlists.inc.php b/templates/show_playlists.inc.php
index 385877f8..ae2d6ecb 100644
--- a/templates/show_playlists.inc.php
+++ b/templates/show_playlists.inc.php
@@ -48,7 +48,7 @@ foreach ($object_ids as $playlist_id) {
<?php } // end foreach ($playlists as $playlist) ?>
<tr class="th-bottom">
<th class="cel_add"><?php echo _('Add'); ?></th>
- <th class="cel_playlist"><?php echo Ajax::text('?page=browse&action=set_sort&sort=name',_('Playlist Name'),'playlist_sort_name'); ?></th>
+ <th class="cel_playlist"><?php echo Ajax::text('?page=browse&action=set_sort&sort=name',_('Playlist Name'),'playlist_sort_name_bottom'); ?></th>
<th class="cel_songs"><?php echo _('# Songs'); ?></th>
<th class="cel_owner"><?php echo _('Owner'); ?></th>
<th class="cel_action"><?php echo _('Actions'); ?></th>
diff --git a/templates/show_songs.inc.php b/templates/show_songs.inc.php
index 0ebd770c..1dd4988f 100644
--- a/templates/show_songs.inc.php
+++ b/templates/show_songs.inc.php
@@ -56,12 +56,12 @@ $ajax_url = Config::get('ajax_url');
<?php } ?>
<tr class="th-bottom">
<th class="cel_add"><?php echo _('Add'); ?></th>
- <th class="cel_song"><?php echo Ajax::text('?page=browse&action=set_sort&sort=title',_('Song Title'),'sort_song_title'); ?></th>
+ <th class="cel_song"><?php echo Ajax::text('?page=browse&action=set_sort&sort=title',_('Song Title'),'sort_song_title_bottom'); ?></th>
<th class="cel_artist"><?php echo _('Artist'); ?></th>
<th class="cel_album"><?php echo _('Album'); ?></th>
<th class="cel_genre"><?php echo _('Genre'); ?></th>
- <th class="cel_track"><?php echo Ajax::text('?page=browse&action=set_sort&sort=track',_('Track'),'sort_song_track'); ?></th>
- <th class="cel_time"><?php echo Ajax::text('?page=browse&action=set_sort&sort=time',_('Time'),'sort_song_time'); ?></th>
+ <th class="cel_track"><?php echo Ajax::text('?page=browse&action=set_sort&sort=track',_('Track'),'sort_song_track_bottom'); ?></th>
+ <th class="cel_time"><?php echo Ajax::text('?page=browse&action=set_sort&sort=time',_('Time'),'sort_song_time_bottom'); ?></th>
<th class="cel_action"><?php echo _('Action'); ?></th>
</tr>
</table>