diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-06 20:17:21 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-06 20:17:21 +0000 |
commit | 22beb1a65d65c9c61fb5d7e181df681fb1a8849e (patch) | |
tree | fcc595461f72ca424bbe2cea557b574849c1c997 | |
parent | 1d12186dba5259dfcf2d0306bb3e34d84dda5304 (diff) | |
download | ampache-22beb1a65d65c9c61fb5d7e181df681fb1a8849e.tar.gz ampache-22beb1a65d65c9c61fb5d7e181df681fb1a8849e.tar.bz2 ampache-22beb1a65d65c9c61fb5d7e181df681fb1a8849e.zip |
added paging to genre sub views, and added missing fields to the song single view
-rw-r--r-- | albums.php | 76 | ||||
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | genre.php | 30 | ||||
-rw-r--r-- | lib/class/album.class.php | 7 | ||||
-rw-r--r-- | lib/class/song.class.php | 2 | ||||
-rw-r--r-- | lib/class/update.class.php | 32 | ||||
-rw-r--r-- | templates/show_edit_access.inc.php | 4 | ||||
-rw-r--r-- | templates/show_song.inc.php | 22 |
8 files changed, 89 insertions, 86 deletions
@@ -89,13 +89,13 @@ switch ($_REQUEST['action']) { $artist = scrub_in($_REQUEST['artist_name']); } elseif ($album->artist_count == '1') { - $artist = $album->artist_name; + $artist = $album->f_artist_name; } if (isset($_REQUEST['album_name'])) { $album_name = scrub_in($_REQUEST['album_name']); } else { - $album_name = $album->name; + $album_name = $album->full_name; } $options['artist'] = $artist; @@ -170,77 +170,6 @@ switch ($_REQUEST['action']) { show_box_bottom(); break; // Browse by Album - case 'broken': - exit; - switch($match) { - case 'Show_all': - $offset_limit = 99999; - $sql = "SELECT album.id FROM song,album ". - " WHERE song.album=album.id ". - "GROUP BY song.album ". - " HAVING COUNT(song.id) > $min_album_size "; - break; - case 'Show_missing_art': - $offset_limit = 99999; - $sql = "SELECT album.id FROM song,album ". - " WHERE song.album=album.id ". - " AND album.art is null ". - "GROUP BY song.album ". - " HAVING COUNT(song.id) > $min_album_size "; - break; - case 'Browse': - case 'show_albums': - $sql = "SELECT album.id FROM song,album ". - " WHERE song.album=album.id ". - "GROUP BY song.album ". - " HAVING COUNT(song.id) > $min_album_size "; - break; - default: - $sql = "SELECT album.id FROM song,album ". - " WHERE song.album=album.id ". - " AND album.name LIKE '$match%'". - "GROUP BY song.album ". - " HAVING COUNT(song.id) > $min_album_size "; - } // 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%'"; - } - $sort_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 ". - "HAVING COUNT(song.id) > $min_album_size "; - $sort_order = 'artist.name'; - break; - default: - - break; - } // switch on special sort types - - // if we are returning - if ($_REQUEST['keep_view']) { - $view->initialize($sort_sql); - } - - // 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 = $user->prefs['offset_limit']; } - $view = new View($sql, 'albums.php',$sort_order,$total_items,$offset_limit); - } - - else { $view = false; } - - if ($view->base_sql) { - $albums = get_albums($view->sql); - require conf('prefix') . '/templates/show_albums.inc.php'; - } - - break; } // end switch on action @@ -248,6 +177,7 @@ switch ($_REQUEST['action']) { * switch on view */ switch ($_REQUEST['action']) { + default: case 'show': $album = new Album($_REQUEST['album']); $album->format(); diff --git a/docs/CHANGELOG b/docs/CHANGELOG index a9983eda..0c1f256c 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.4-Alpha4 + - Added paging to genre sub-pages + - Added missing song data fields to single song view - Fixed display issue with playlists when deleting a song - Fixed sorting of 'add to Playlist' menu on rightbar - Added another layer of checking on catalog deletes to help @@ -34,9 +34,13 @@ switch($_REQUEST['action']) { $genre = new Genre($_REQUEST['genre_id']); show_genre($_REQUEST['genre_id']); $object_ids = $genre->get_songs(); - show_box_top(_('Songs')); - require_once Config::get('prefix') . '/templates/show_songs.inc.php'; - show_box_bottom(); + echo "<div id=\"browse_content\">"; + Browse::reset_filters(); + Browse::set_type('song'); + Browse::set_sort('name','ASC'); + Browse::save_objects($object_ids); + Browse::show_objects($object_ids); + echo "</div>"; break; case 'show_genre': default: @@ -44,17 +48,25 @@ switch($_REQUEST['action']) { $genre = new Genre($_REQUEST['genre_id']); show_genre($_REQUEST['genre_id']); $object_ids = $genre->get_albums(); - show_box_top(_('Albums')); - require Config::get('prefix') . '/templates/show_albums.inc.php'; - show_box_bottom(); + echo "<div id=\"browse_content\">"; + Browse::reset_filters(); + Browse::set_type('album'); + Browse::set_sort('name','ASC'); + Browse::save_objects($object_ids); + Browse::show_objects($object_ids); + echo "</div>"; break; case 'show_artists': $genre = new Genre($_REQUEST['genre_id']); show_genre($_REQUEST['genre_id']); $object_ids = $genre->get_artists(); - show_box_top(_('Artists')); - require_once Config::get('prefix') . '/templates/show_artists.inc.php'; - show_box_bottom(); + echo "<div id=\"browse_content\">"; + Browse::reset_filters(); + Browse::set_type('artist'); + Browse::set_sort('name','ASC'); + Browse::save_objects($object_ids); + Browse::show_objects($object_ids); + echo "</div>"; break; } // action diff --git a/lib/class/album.class.php b/lib/class/album.class.php index d0beedce..ca6f1b10 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -211,14 +211,14 @@ class Album { /* Truncate the string if it's to long */ $this->f_name = truncate_with_ellipsis($this->full_name,Config::get('ellipsis_threshold_album')); - $this->f_name_link = "<a href=\"$web_path/albums.php?action=show&album=" . scrub_out($this->id) . "\" title=\"" . scrub_out($this->full_name) . "\">" . $this->f_name; + $this->f_name_link = "<a href=\"$web_path/albums.php?action=show&album=" . scrub_out($this->id) . "\" title=\"" . scrub_out($this->full_name) . "\">" . $this->f_name; // If we've got a disk append it if ($this->disk) { $this->f_name_link .= " <span class=\"discnb disc" .$this->disk. "\">[" . _('Disk') . " " . $this->disk . "]</span>"; } $this->f_name_link .="</a>"; - $this->f_link = $this->f_name_link; + $this->f_link = $this->f_name_link; $this->f_title = $full_name; if ($this->artist_count == '1') { $artist = scrub_out(truncate_with_ellipsis(trim($this->artist_prefix . ' ' . $this->artist_name),Config::get('ellipsis_threshold_album'))); @@ -234,6 +234,9 @@ class Album { $this->year = "N/A"; } + // Format the artist name to include the prefix + $this->f_artist_name = trim($this->artist_prefix . ' ' . $this->artist_name); + } // format /** diff --git a/lib/class/song.class.php b/lib/class/song.class.php index 8cc89308..b7c59621 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -661,6 +661,8 @@ class Song { */ function format() { + $this->fill_ext_info(); + // Format the filename preg_match("/^.*\/(.*?)$/",$this->file, $short); $this->f_file = htmlspecialchars($short[1]); diff --git a/lib/class/update.class.php b/lib/class/update.class.php index 6f36a107..0d5bacfe 100644 --- a/lib/class/update.class.php +++ b/lib/class/update.class.php @@ -247,6 +247,11 @@ class Update { $version[] = array('version' => '340012','description'=>$update_string); + $update_string = '- Removed Unused Preferneces<br />' . + '- Changed all XML-RPC acls to RPC to reflect inclusion of new API<br />'; + +// $version[] = array('version' => '340013','description'=>$update_string) + return $version; } // populate_version @@ -1042,5 +1047,32 @@ class Update { } // update_340012 + /** + * update_340013 + * This update removes a whole bunch of preferences that are no longer + * being used in any way, and changes the ACL XML-RPC to just RPC + */ + public static function update_340013() { + + $sql = "DELETE FROM `preference` WHERE `name`='localplay_mpd_hostname' OR `name`='localplay_mpd_port' " . + "OR `name`='direct_link' OR `name`='localplay_level' OR `name`='localplay_mpd_password'"; + $db_results = Dba::query($sql); + + $sql = "UPDATE `access_list` SET `type`='rpc' WHERE `type`='xml-rpc'"; + $db_results = Dba::query($sql); + + $sql = "SELECT `id` FROM `user`"; + $db_results = Dba::query($sql); + + User::fix_preferences('-1'); + + while ($r = Dba::fetch_assoc($db_results)) { + User::fix_preferences($r['id']); + } // while we're fixing the useres stuff + + self::set_version('db_version','340013'); + + } // update_340013 + } // end update class ?> diff --git a/templates/show_edit_access.inc.php b/templates/show_edit_access.inc.php index 4e9bf68a..676a8570 100644 --- a/templates/show_edit_access.inc.php +++ b/templates/show_edit_access.inc.php @@ -34,7 +34,7 @@ <option value="stream"<?php echo $sl_stream; ?>><?php echo _('Stream Access'); ?></option> <option value="interface"<?php echo $sl_interface; ?>><?php echo _('Web Interface'); ?></option> <option value="network"<?php echo $sl_network; ?>><?php echo _('Local Network Definition'); ?></option> - <option value="xml-rpc"<?php echo $sl_xml-rpc; ?>><?php echo _('XML-RPC'); ?></option> + <option value="rpc"<?php echo $sl_rpc; ?>><?php echo _('RPC'); ?></option> </select> </td> @@ -57,7 +57,7 @@ <?php show_user_select('user',$access->user); ?> </td> </tr> -<?php if ($access->type == 'xml-rpc') { ?> +<?php if ($access->type == 'rpc') { ?> <tr> <td><?php echo _('Remote Key'); ?></td> <td> diff --git a/templates/show_song.inc.php b/templates/show_song.inc.php index 9f7b19e5..d9180d0b 100644 --- a/templates/show_song.inc.php +++ b/templates/show_song.inc.php @@ -38,13 +38,35 @@ <td><?php echo $song->f_genre_link; ?></td> </tr> <tr> + <td><?php echo _('Length'); ?></td> + <td><?php echo scrub_out($song->f_time); ?></td> +</tr> +<tr> + <td><?php echo _('Comment'); ?></td> + <td><?php echo scrub_out($song->comment); ?></td> +</tr> +<tr> + <td><?php echo _('Label'); ?></td> + <td><?php echo scrub_out($song->label); ?></td> +</tr> +<tr> + <td><?php echo _('Language'); ?></td> + <td><?php echo scrub_out($song->language); ?></td> +</tr> +<tr> + <td><?php echo _('Catalog Number'); ?></td> + <td><?php echo scrub_out($song->catalog_number); ?></td> +</tr> +<tr> <td><?php echo _('Bitrate'); ?></td> <td><?php echo scrub_out($song->f_bitrate); ?></td> </tr> +<?php if ($GLOBALS['user']->has_access('75')) { ?> <tr> <td><?php echo _('Filename'); ?></td> <td><?php echo scrub_out($song->file); ?> (<?php echo $song->f_size; ?>MB)</td> </tr> +<?php } ?> <?php if ($song->update_time) { ?> <tr> <td><?php echo _('Last Updated'); ?></td> |