mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 09:49:30 +02:00
* New Play/Random icons (last ones I swear)
* Fixed up missing actions/icons on genre browse * Fixed batch logic to show access denied, rather then redirecting * Fixed a minor css issue on classic that caused the album art to float around
This commit is contained in:
parent
3460950693
commit
9a92a34e2c
10 changed files with 99 additions and 79 deletions
108
batch.php
108
batch.php
|
@ -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
|
||||
|
||||
?>
|
||||
|
|
|
@ -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
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 749 B |
Binary file not shown.
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 506 B |
|
@ -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
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 ?>
|
||||
|
|
|
@ -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'];
|
||||
|
|
|
@ -553,7 +553,6 @@ margin-right:5em;
|
|||
.np_row {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
display: block;
|
||||
}
|
||||
.np_cell {
|
||||
margin: 10px;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue