diff options
-rw-r--r-- | batch.php | 108 | ||||
-rwxr-xr-x | docs/CHANGELOG | 4 | ||||
-rw-r--r-- | images/icon_all.png | bin | 385 -> 749 bytes | |||
-rw-r--r-- | images/icon_random.png | bin | 367 -> 506 bytes | |||
-rw-r--r-- | lib/class/genre.class.php | 7 | ||||
-rw-r--r-- | templates/show_albums.inc | 17 | ||||
-rw-r--r-- | templates/show_artists.inc | 14 | ||||
-rw-r--r-- | templates/show_genres.inc.php | 25 | ||||
-rw-r--r-- | templates/show_now_playing.inc | 2 | ||||
-rw-r--r-- | themes/classic/templates/default.css | 1 |
10 files changed, 99 insertions, 79 deletions
@@ -5,9 +5,8 @@ All rights reserved. This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -32,55 +31,62 @@ * in your PHP build. */ - require_once('lib/init.php'); - //test that batch download is permitted (user or system?) +require_once('lib/init.php'); - /* Drop the normal Time limit constraints, this can take a while */ - set_time_limit(0); +//test that batch download is permitted +if (!batch_ok()) { + access_denied(); + exit; +} - if(batch_ok()) { - switch( scrub_in( $_REQUEST['action'] ) ) { - case 'download_selected': - $type = scrub_in($_REQUEST['type']); - if ($type == 'album') { - $song_ids = get_songs_from_type($type,$_POST['song'],$_REQUEST['artist_id']); - } - elseif ($_REQUEST['playlist_id']) { - $playlist = new Playlist($_REQUEST['playlist_id']); - $song_ids = $playlist->get_songs($_REQUEST['song']); - } - else { - $song_ids = $_POST['song']; - } - $name = "selected-" . date("m-d-Y",time()); - $song_files = get_song_files($song_ids); - set_memory_limit($song_files[1]+32); - send_zip($name,$song_files[0]); - break; - case "pl": - $id = scrub_in( $_REQUEST['id'] ); - $pl = new Playlist( $id ); - $name = $pl->name; - $song_ids = $pl->get_songs(); - $song_files = get_song_files( $song_ids ); - set_memory_limit( $song_files[1]+32 ); - send_zip( $name, $song_files[0] ); - break; - case "alb": - $id = scrub_in( $_REQUEST['id'] ); - $alb = new Album( $id ); - $name = $alb->name; - $song_ids = $alb->get_song_ids(); - $song_files = get_song_files( $song_ids ); - set_memory_limit( $song_files[1]+32 ); - send_zip( $name, $song_files[0] ); - break; - default: - header( "Location:" . conf('web_path') . "/index.php?amp_error=Unknown action on batch.php: {$_REQUEST['action']}" ); - break; - } // action switch - } else { // bulk download permissions - header( "Location: " . conf('web_path') . "/index.php?amp_error=Download disabled" ); - } // no bulk download permissions +/* Drop the normal Time limit constraints, this can take a while */ +set_time_limit(0); + +switch( scrub_in( $_REQUEST['action'] ) ) { + case 'download_selected': + $type = scrub_in($_REQUEST['type']); + if ($type == 'album') { + $song_ids = get_songs_from_type($type,$_POST['song'],$_REQUEST['artist_id']); + } + elseif ($_REQUEST['playlist_id']) { + $playlist = new Playlist($_REQUEST['playlist_id']); + $song_ids = $playlist->get_songs($_REQUEST['song']); + } + else { + $song_ids = $_POST['song']; + } + $name = "selected-" . date("m-d-Y",time()); + $song_files = get_song_files($song_ids); + set_memory_limit($song_files[1]+32); + send_zip($name,$song_files[0]); + break; + case 'pl': + $id = scrub_in($_REQUEST['id']); + $pl = new Playlist($id); + $song_ids = $pl->get_songs(); + $song_files = get_song_files( $song_ids ); + set_memory_limit($song_files[1]+32); + send_zip($pl->name, $song_files[0]); + break; + case 'alb': + $id = scrub_in($_REQUEST['id']); + $alb = new Album($id); + $song_ids = $alb->get_song_ids(); + $song_files = get_song_files($song_ids); + set_memory_limit($song_files[1]+32); + send_zip($alb->name, $song_files[0]); + break; + case 'genre': + $id = scrub_in($_REQUEST['id']); + $genre = new Genre($id); + $song_ids = $genre->get_songs(); + $song_files = get_song_files($song_ids); + set_memory_limit($song_files[1]+32); + send_zip($genre->name,$song_files[0]); + break; + default: + // Rien a faire + break; +} // action switch ?> diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 9676cbc7..fd82bcfe 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,10 @@ -------------------------------------------------------------------------- v.3.3.3 + - Fixed batch page to correctly show access denied rather then + redirecting on error + - Fixed Genre actions to actually work + - Added http://www.famfamfam.com icons to browse functions - Fixed Flash Player now playing issue - Fixed a img resize logic error that could cause no art to display if resize was on and resize failed diff --git a/images/icon_all.png b/images/icon_all.png Binary files differindex a8b3ede3..f54bf736 100644 --- a/images/icon_all.png +++ b/images/icon_all.png diff --git a/images/icon_random.png b/images/icon_random.png Binary files differindex 1b7b6d87..d3087dfc 100644 --- a/images/icon_random.png +++ b/images/icon_random.png diff --git a/lib/class/genre.class.php b/lib/class/genre.class.php index b7772679..3d193be2 100644 --- a/lib/class/genre.class.php +++ b/lib/class/genre.class.php @@ -71,10 +71,11 @@ class Genre { */ function format_genre() { - $this->link = "<a href=\"" . conf('web_path') . "/genre.php?action=show_genre&genre_id=" . $this->id . "\">" . $this->name . "</a>"; + $this->link = "<a href=\"" . conf('web_path') . "/genre.php?action=show_genre&genre_id=" . $this->id . "\">" . scrub_out($this->name) . "</a>"; - $this->play_link = conf('web_path') . "/song.php?action=genre&genre=" . $this->id; - $this->random_link = conf('web_path') . "/song.php?action=random_genre&genre=" . $this->id; + $this->play_link = conf('web_path') . '/song.php?action=genre&genre=' . $this->id; + $this->random_link = conf('web_path') . '/song.php?action=random_genre&genre=' . $this->id; + $this->download_link = conf('web_path') . '/batch.php?action=genre&id=' . $this->id; } // format_genre diff --git a/templates/show_albums.inc b/templates/show_albums.inc index fa2b63ec..5ebdebf0 100644 --- a/templates/show_albums.inc +++ b/templates/show_albums.inc @@ -57,22 +57,21 @@ foreach ($albums as $album) { <td><?php echo $album->songs; ?></td> <td><?php echo $album->year; ?></td> <td nowrap="nowrap"> - <?php echo _('Play'); ?>: <a href="<?php echo $web_path; ?>/song.php?action=album&album_id=<?php echo $album->id; ?>"> - <?php echo _('All'); ?> - </a> | + <?php echo get_user_icon('all'); ?> + </a> <a href="<?php echo $web_path; ?>/song.php?action=album_random&album_id=<?php echo $album->id; ?>"> - <?php echo _('Random'); ?> - </a> | + <?php echo get_user_icon('random'); ?> + </a> <?php if (batch_ok()) { ?> <a href="<?php echo $web_path; ?>/batch.php?action=alb&id=<?php echo $album->id; ?>"> - <?php echo _('Download'); ?> - </a> | + <?php echo get_user_icon('download'); ?> + </a> <?php } ?> <?php if ($GLOBALS['user']->has_access('50')) { ?> <a href="<?php echo $web_path; ?>/admin/flag.php?action=show_edit_album&album_id=<?php echo $album->id; ?>"> - <?php echo _('Edit'); ?> - </a> | + <?php echo get_user_icon('edit'); ?> + </a> <?php } ?> </td> </tr> diff --git a/templates/show_artists.inc b/templates/show_artists.inc index a3632350..4e2cef72 100644 --- a/templates/show_artists.inc +++ b/templates/show_artists.inc @@ -51,11 +51,17 @@ foreach ($artists as $artist) { ?> <td><?php echo $artist['name']; ?></td> <td><?php echo $artist['songs']; ?></td> <td><?php echo $artist['albums']; ?></td> - <td nowrap="nowrap"> <?php echo _("Play"); ?> : - <a href="<?php echo $web_path; ?>/song.php?action=artist&artist_id=<?php echo $artist['id']; ?>"><?php echo _('All'); ?></a> | - <a href="<?php echo $web_path; ?>/song.php?action=artist_random&artist_id=<?php echo $artist['id']; ?>"><?php echo _('Random'); ?></a> + <td nowrap="nowrap"> + <a href="<?php echo $web_path; ?>/song.php?action=artist&artist_id=<?php echo $artist['id']; ?>"> + <?php echo get_user_icon('all'); ?> + </a> + <a href="<?php echo $web_path; ?>/song.php?action=artist_random&artist_id=<?php echo $artist['id']; ?>"> + <?php echo get_user_icon('random'); ?> + </a> <?php if ($GLOBALS['user']->has_access(100)) { ?> - | <a href="<?php echo $web_path; ?>/admin/flag.php?action=show_edit_artist&artist_id=<?php echo $artist['id']; ?>"><?php echo _('Edit'); ?></a> + <a href="<?php echo $web_path; ?>/admin/flag.php?action=show_edit_artist&artist_id=<?php echo $artist['id']; ?>"> + <?php echo get_user_icon('edit'); ?> + </a> <?php } ?> </td> </tr> diff --git a/templates/show_genres.inc.php b/templates/show_genres.inc.php index 176ad93b..0ffd7492 100644 --- a/templates/show_genres.inc.php +++ b/templates/show_genres.inc.php @@ -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 @@ -33,9 +33,9 @@ $total_items = $view->total_items; </td> </tr> <tr class="table-header"> - <td><?php echo _("Genre"); ?></td> - <td><?php echo _("Songs"); ?></td> - <td><?php echo _("Action"); ?></td> + <td><?php echo _('Genre'); ?></td> + <td><?php echo _('Songs'); ?></td> + <td><?php echo _('Action'); ?></td> </tr> <?php foreach ($genres as $genre) { @@ -44,12 +44,17 @@ foreach ($genres as $genre) { <td><?php echo $genre->link; ?></td> <td><?php echo $genre->get_song_count(); ?></td> <td> - <?php echo _("Play"); ?>: - <a href="<?php echo $genre->play_link; ?>">All</a> - | - <a href="<?php echo $genre->random_link; ?>">Random</a> - | - Download + <a href="<?php echo $genre->play_link; ?>"> + <?php echo get_user_icon('all'); ?> + </a> + <a href="<?php echo $genre->random_link; ?>"> + <?php echo get_user_icon('random'); ?> + </a> + <?php if (batch_ok()) { ?> + <a href="<?php echo $genre->download_link; ?>"> + <?php echo get_user_icon('download'); ?> + </a> + <?php } ?> </td> </tr> <?php } // end foreach genres ?> diff --git a/templates/show_now_playing.inc b/templates/show_now_playing.inc index 5c0cc2b5..f56a8fee 100644 --- a/templates/show_now_playing.inc +++ b/templates/show_now_playing.inc @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. if (count($results)) { ?> <?php show_box_top(_('Now Playing')); ?> -<table> +<table class="tabledata"> <?php foreach ($results as $item) { $song = $item['song']; diff --git a/themes/classic/templates/default.css b/themes/classic/templates/default.css index c9cc46f3..b1129833 100644 --- a/themes/classic/templates/default.css +++ b/themes/classic/templates/default.css @@ -553,7 +553,6 @@ margin-right:5em; .np_row { padding-top: 3px; padding-bottom: 3px; - display: block; } .np_cell { margin: 10px; |