mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 17:59:21 +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
36
batch.php
36
batch.php
|
@ -5,9 +5,8 @@
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License v2
|
||||||
as published by the Free Software Foundation; either version 2
|
as published by the Free Software Foundation.
|
||||||
of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
@ -33,12 +32,16 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once('lib/init.php');
|
require_once('lib/init.php');
|
||||||
//test that batch download is permitted (user or system?)
|
|
||||||
|
//test that batch download is permitted
|
||||||
|
if (!batch_ok()) {
|
||||||
|
access_denied();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
/* Drop the normal Time limit constraints, this can take a while */
|
/* Drop the normal Time limit constraints, this can take a while */
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
if(batch_ok()) {
|
|
||||||
switch( scrub_in( $_REQUEST['action'] ) ) {
|
switch( scrub_in( $_REQUEST['action'] ) ) {
|
||||||
case 'download_selected':
|
case 'download_selected':
|
||||||
$type = scrub_in($_REQUEST['type']);
|
$type = scrub_in($_REQUEST['type']);
|
||||||
|
@ -57,30 +60,33 @@
|
||||||
set_memory_limit($song_files[1]+32);
|
set_memory_limit($song_files[1]+32);
|
||||||
send_zip($name,$song_files[0]);
|
send_zip($name,$song_files[0]);
|
||||||
break;
|
break;
|
||||||
case "pl":
|
case 'pl':
|
||||||
$id = scrub_in($_REQUEST['id']);
|
$id = scrub_in($_REQUEST['id']);
|
||||||
$pl = new Playlist($id);
|
$pl = new Playlist($id);
|
||||||
$name = $pl->name;
|
|
||||||
$song_ids = $pl->get_songs();
|
$song_ids = $pl->get_songs();
|
||||||
$song_files = get_song_files( $song_ids );
|
$song_files = get_song_files( $song_ids );
|
||||||
set_memory_limit($song_files[1]+32);
|
set_memory_limit($song_files[1]+32);
|
||||||
send_zip( $name, $song_files[0] );
|
send_zip($pl->name, $song_files[0]);
|
||||||
break;
|
break;
|
||||||
case "alb":
|
case 'alb':
|
||||||
$id = scrub_in($_REQUEST['id']);
|
$id = scrub_in($_REQUEST['id']);
|
||||||
$alb = new Album($id);
|
$alb = new Album($id);
|
||||||
$name = $alb->name;
|
|
||||||
$song_ids = $alb->get_song_ids();
|
$song_ids = $alb->get_song_ids();
|
||||||
$song_files = get_song_files($song_ids);
|
$song_files = get_song_files($song_ids);
|
||||||
set_memory_limit($song_files[1]+32);
|
set_memory_limit($song_files[1]+32);
|
||||||
send_zip( $name, $song_files[0] );
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
header( "Location:" . conf('web_path') . "/index.php?amp_error=Unknown action on batch.php: {$_REQUEST['action']}" );
|
// Rien a faire
|
||||||
break;
|
break;
|
||||||
} // action switch
|
} // action switch
|
||||||
} else { // bulk download permissions
|
|
||||||
header( "Location: " . conf('web_path') . "/index.php?amp_error=Download disabled" );
|
|
||||||
} // no bulk download permissions
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
v.3.3.3
|
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 Flash Player now playing issue
|
||||||
- Fixed a img resize logic error that could cause no art to
|
- Fixed a img resize logic error that could cause no art to
|
||||||
display if resize was on and resize failed
|
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() {
|
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->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->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
|
} // format_genre
|
||||||
|
|
||||||
|
|
|
@ -57,22 +57,21 @@ foreach ($albums as $album) {
|
||||||
<td><?php echo $album->songs; ?></td>
|
<td><?php echo $album->songs; ?></td>
|
||||||
<td><?php echo $album->year; ?></td>
|
<td><?php echo $album->year; ?></td>
|
||||||
<td nowrap="nowrap">
|
<td nowrap="nowrap">
|
||||||
<?php echo _('Play'); ?>:
|
|
||||||
<a href="<?php echo $web_path; ?>/song.php?action=album&album_id=<?php echo $album->id; ?>">
|
<a href="<?php echo $web_path; ?>/song.php?action=album&album_id=<?php echo $album->id; ?>">
|
||||||
<?php echo _('All'); ?>
|
<?php echo get_user_icon('all'); ?>
|
||||||
</a> |
|
</a>
|
||||||
<a href="<?php echo $web_path; ?>/song.php?action=album_random&album_id=<?php echo $album->id; ?>">
|
<a href="<?php echo $web_path; ?>/song.php?action=album_random&album_id=<?php echo $album->id; ?>">
|
||||||
<?php echo _('Random'); ?>
|
<?php echo get_user_icon('random'); ?>
|
||||||
</a> |
|
</a>
|
||||||
<?php if (batch_ok()) { ?>
|
<?php if (batch_ok()) { ?>
|
||||||
<a href="<?php echo $web_path; ?>/batch.php?action=alb&id=<?php echo $album->id; ?>">
|
<a href="<?php echo $web_path; ?>/batch.php?action=alb&id=<?php echo $album->id; ?>">
|
||||||
<?php echo _('Download'); ?>
|
<?php echo get_user_icon('download'); ?>
|
||||||
</a> |
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if ($GLOBALS['user']->has_access('50')) { ?>
|
<?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; ?>">
|
<a href="<?php echo $web_path; ?>/admin/flag.php?action=show_edit_album&album_id=<?php echo $album->id; ?>">
|
||||||
<?php echo _('Edit'); ?>
|
<?php echo get_user_icon('edit'); ?>
|
||||||
</a> |
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -51,11 +51,17 @@ foreach ($artists as $artist) { ?>
|
||||||
<td><?php echo $artist['name']; ?></td>
|
<td><?php echo $artist['name']; ?></td>
|
||||||
<td><?php echo $artist['songs']; ?></td>
|
<td><?php echo $artist['songs']; ?></td>
|
||||||
<td><?php echo $artist['albums']; ?></td>
|
<td><?php echo $artist['albums']; ?></td>
|
||||||
<td nowrap="nowrap"> <?php echo _("Play"); ?> :
|
<td nowrap="nowrap">
|
||||||
<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&artist_id=<?php echo $artist['id']; ?>">
|
||||||
<a href="<?php echo $web_path; ?>/song.php?action=artist_random&artist_id=<?php echo $artist['id']; ?>"><?php echo _('Random'); ?></a>
|
<?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)) { ?>
|
<?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 } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2001 - 2005 Ampache.org
|
Copyright (c) 2001 - 2006 Ampache.org
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
|
@ -33,9 +33,9 @@ $total_items = $view->total_items;
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="table-header">
|
<tr class="table-header">
|
||||||
<td><?php echo _("Genre"); ?></td>
|
<td><?php echo _('Genre'); ?></td>
|
||||||
<td><?php echo _("Songs"); ?></td>
|
<td><?php echo _('Songs'); ?></td>
|
||||||
<td><?php echo _("Action"); ?></td>
|
<td><?php echo _('Action'); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
foreach ($genres as $genre) {
|
foreach ($genres as $genre) {
|
||||||
|
@ -44,12 +44,17 @@ foreach ($genres as $genre) {
|
||||||
<td><?php echo $genre->link; ?></td>
|
<td><?php echo $genre->link; ?></td>
|
||||||
<td><?php echo $genre->get_song_count(); ?></td>
|
<td><?php echo $genre->get_song_count(); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo _("Play"); ?>:
|
<a href="<?php echo $genre->play_link; ?>">
|
||||||
<a href="<?php echo $genre->play_link; ?>">All</a>
|
<?php echo get_user_icon('all'); ?>
|
||||||
|
|
</a>
|
||||||
<a href="<?php echo $genre->random_link; ?>">Random</a>
|
<a href="<?php echo $genre->random_link; ?>">
|
||||||
|
|
<?php echo get_user_icon('random'); ?>
|
||||||
Download
|
</a>
|
||||||
|
<?php if (batch_ok()) { ?>
|
||||||
|
<a href="<?php echo $genre->download_link; ?>">
|
||||||
|
<?php echo get_user_icon('download'); ?>
|
||||||
|
</a>
|
||||||
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } // end foreach genres ?>
|
<?php } // end foreach genres ?>
|
||||||
|
|
|
@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
if (count($results)) {
|
if (count($results)) {
|
||||||
?>
|
?>
|
||||||
<?php show_box_top(_('Now Playing')); ?>
|
<?php show_box_top(_('Now Playing')); ?>
|
||||||
<table>
|
<table class="tabledata">
|
||||||
<?php
|
<?php
|
||||||
foreach ($results as $item) {
|
foreach ($results as $item) {
|
||||||
$song = $item['song'];
|
$song = $item['song'];
|
||||||
|
|
|
@ -553,7 +553,6 @@ margin-right:5em;
|
||||||
.np_row {
|
.np_row {
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
padding-bottom: 3px;
|
padding-bottom: 3px;
|
||||||
display: block;
|
|
||||||
}
|
}
|
||||||
.np_cell {
|
.np_cell {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue