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 | |
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
-rw-r--r-- | albums.php | 19 | ||||
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/stream.lib.php | 8 | ||||
-rw-r--r-- | modules/init.php | 1 | ||||
-rw-r--r-- | templates/show_albums.inc | 16 | ||||
-rw-r--r-- | templates/show_users.inc | 2 |
6 files changed, 34 insertions, 14 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; } diff --git a/docs/CHANGELOG b/docs/CHANGELOG index a7d6ff49..191955c5 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.3.2-Beta2 + - Added horrible hack to make Artist sorting work in the Album + browse page, this is temp until Ampache 3.4 - Fixed a problem with the playlist update confirmation page - Fixed css issues with preferences (Thx WarrenG) - Added dump album art command line script and tweaked catalog diff --git a/lib/stream.lib.php b/lib/stream.lib.php index 37674d7b..9b99d752 100644 --- a/lib/stream.lib.php +++ b/lib/stream.lib.php @@ -180,9 +180,7 @@ function start_downsample($song,$now_playing_id=0,$song_name=0) { if ($min_bitrate > 1 AND ($max_bitrate/$active_streams) < $min_bitrate) { /* Log the failure */ - if (conf('debug')) { - log_event($user->username,' downsample ',"Error: Max bandwidith already allocated. $active_streams Active Streams"); - } + debug_event('downsample',"Error: Max bandwidith already allocated. $active_streams Active Streams",'2'); /* Toast the now playing entry, then tell em to try again later */ delete_now_playing($now_playing_id); @@ -197,9 +195,7 @@ function start_downsample($song,$now_playing_id=0,$song_name=0) { // Never go over the users sample rate if ($sample_rate > $user_sample_rate) { $sample_rate = $user_sample_rate; } - if (conf('debug')) { - log_event($GLOBALS['user']->username, ' downsample ',"Downsampled: $active_streams current active streams, downsampling to $sample_rate"); - } + debug_event('downsample',"Downsampled: $active_streams current active streams, downsampling to $sample_rate",'2'); } // end if we've got bitrates diff --git a/modules/init.php b/modules/init.php index fe440eb3..75d6abb6 100644 --- a/modules/init.php +++ b/modules/init.php @@ -224,6 +224,7 @@ if (($gc_divisor / $gc_probability) > 5) { $new_gc_probability = $gc_divisor * .2; ini_set('session.gc_probability',$new_gc_probability); } + /* END Set PHP Vars */ /* Overwrite them with the DB preferences */ diff --git a/templates/show_albums.inc b/templates/show_albums.inc index da6a505c..e23f88e8 100644 --- a/templates/show_albums.inc +++ b/templates/show_albums.inc @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2005 Ampache.org + Copyright (c) 2001 - 2006 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -37,8 +37,10 @@ $total_items = $view->total_items; <td> <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=album.name&sort_order=0"><?php echo _("Album"); ?></a> </td> - <td> <?php echo _("Artist"); ?> </td> - <td> <?php echo _("Songs"); ?> </td> + <td> + <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=artist.name&type=album_sort"><?php echo _('Artist'); ?></a> + </td> + <td> <?php echo _('Songs'); ?> </td> <td> <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=album.year&sort_order=0"><?php echo _("Year"); ?></a> </td> @@ -67,12 +69,14 @@ foreach ($albums as $album) { <td> <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=album.name&sort_order=0"><?php echo _("Album"); ?></a> </td> - <td> <?php echo _("Artist"); ?> </td> - <td> <?php echo _("Songs"); ?> </td> + <td> + <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=artist.name&type=album_sort"><?php echo _('Artist'); ?></a> + </td> + <td><?php echo _('Songs'); ?></td> <td> <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=album.year&sort_order=0"><?php echo _("Year"); ?></a> </td> - <td> <?php echo _("Action"); ?> </td> + <td><?php echo _('Action'); ?></td> </tr> <tr class="even" align="center"> <td colspan="5"> diff --git a/templates/show_users.inc b/templates/show_users.inc index 143c87bb..2ca1c53f 100644 --- a/templates/show_users.inc +++ b/templates/show_users.inc @@ -83,7 +83,7 @@ while ($results = mysql_fetch_object($db_result)) { if (!$user->create_date) { $create_date = "Unknown"; } ?> -<tr class="even"> +<tr class="<?php echo flip_class(); ?>"> <td> <a href="<?php echo $web_path; ?>/admin/users.php?action=edit&user=<?php echo $user->username; ?>"> <?php echo $user->fullname; ?> (<?php echo $user->username; ?>) |