summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-08-03 05:46:33 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-08-03 05:46:33 +0000
commit7899c3488f4288c8618d73c8ea0ef8e5e07f9ae5 (patch)
tree64be964b83e9990aa110ce55bd27da3112622bf1
parentf5fd6eb89a6416a65bf088c922d7566113509a7c (diff)
downloadampache-7899c3488f4288c8618d73c8ea0ef8e5e07f9ae5.tar.gz
ampache-7899c3488f4288c8618d73c8ea0ef8e5e07f9ae5.tar.bz2
ampache-7899c3488f4288c8618d73c8ea0ef8e5e07f9ae5.zip
added download selected button
-rw-r--r--batch.php15
-rwxr-xr-xdocs/CHANGELOG1
-rw-r--r--lib/artist.lib.php2
-rw-r--r--modules/init.php2
-rw-r--r--templates/show_play_selected.inc.php10
5 files changed, 28 insertions, 2 deletions
diff --git a/batch.php b/batch.php
index 752176c9..80f162f5 100644
--- a/batch.php
+++ b/batch.php
@@ -39,8 +39,21 @@
set_time_limit(0);
- if( batch_ok( ) ) {
+ 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']);
+ }
+ 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]+16);
+ send_zip($name,$song_files[0]);
+ break;
case "pl":
$id = scrub_in( $_REQUEST['id'] );
$pl = new Playlist( $id );
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 434577e6..087e3520 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -25,6 +25,7 @@
- Added British English (Thx ??? <I need to look it up>)
- Added optional automatic resizing of thumbnails using php-gd
- Improved Upload System (Thx Rosensama)
+ - Added Download Selected Option if Zip Downloads are allowed
--------------------------------------------------------------------------
diff --git a/lib/artist.lib.php b/lib/artist.lib.php
index 38a93c75..aa89e482 100644
--- a/lib/artist.lib.php
+++ b/lib/artist.lib.php
@@ -93,6 +93,7 @@ function show_artists ($match = '') {
$offset_limit = $_SESSION['userdata']['offset_limit'];
}
$view = new View($query,'artists.php','name',$total_items,$offset_limit);
+
} // end if creating view object
if (is_array($match)) {
@@ -102,6 +103,7 @@ function show_artists ($match = '') {
$db_results = mysql_query($view->sql, $dbh);
while ($r = @mysql_fetch_array($db_results)) {
+ //FIXME: This seriously needs to be updated to use the artist object
$artist_info = get_artist_info($r[0]);
$artist = format_artist($artist_info);
// Only Add this artist if there is information to go along with it
diff --git a/modules/init.php b/modules/init.php
index efcef4b8..eedc6d12 100644
--- a/modules/init.php
+++ b/modules/init.php
@@ -83,7 +83,7 @@ if (!$results['conf']['allow_stream_playback']) {
}
$results['conf']['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['conf']['web_path'];
-$results['conf']['version'] = '3.3.2-Alpha2 Build (003)';
+$results['conf']['version'] = '3.3.2-Alpha2 Build (004)';
$results['conf']['catalog_file_pattern']= 'mp3|mpc|m4p|m4a|mp4|aac|ogg|rm|wma|asf|flac|spx';
$results['libglue']['local_table'] = 'session';
$results['libglue']['local_sid'] = 'id';
diff --git a/templates/show_play_selected.inc.php b/templates/show_play_selected.inc.php
index 38d4c62d..dab5369d 100644
--- a/templates/show_play_selected.inc.php
+++ b/templates/show_play_selected.inc.php
@@ -35,12 +35,22 @@ function ToSong(action)
document.songs.submit(); // Submit the page
return true;
}
+function ToBatch(action)
+{
+ document.songs.action = "<?php echo conf('web_path'); ?>/batch.php?action=" + action;
+ document.songs.submit();
+ return true;
+}
-->
</script>
<table border="0" cellpadding="14" cellspacing="0" class="text-box">
<tr align="left">
<td>
<input class="button" type="button" name="super_action" value="<?php echo _("Play Selected"); ?>" onclick="return ToSong('play_selected');" />
+ <?php if (batch_ok()) { ?>
+ &nbsp;&nbsp;
+ <input class="button" type="button" name="super_action" value="<?php echo _("Download Selected"); ?>" onclick="return ToBatch('download_selected');" />
+ <? } ?>
<!-- <input class="button" type="button" name="super_action" value="<?php echo _("Flag Selected"); ?>" />
<input class="button" type="button" name="super_action" value="<?php echo _("Edit Selected"); ?>" />
-->