summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpb1dft <pb1dft@ampache>2006-11-17 00:43:11 +0000
committerpb1dft <pb1dft@ampache>2006-11-17 00:43:11 +0000
commitca3d4572837b4caebee850e11fe3f591bd765dff (patch)
treee5b7ffc246295257ba8e4ff466061341647245ce
parentad6644d6cb748929108dad3143021e85ed048906 (diff)
downloadampache-ca3d4572837b4caebee850e11fe3f591bd765dff.tar.gz
ampache-ca3d4572837b4caebee850e11fe3f591bd765dff.tar.bz2
ampache-ca3d4572837b4caebee850e11fe3f591bd765dff.zip
Fixed upload playlist and a minor issue in most popular
-rw-r--r--lib/general.lib.php2
-rw-r--r--playlist.php8
-rw-r--r--templates/show_import_playlist.inc.php13
3 files changed, 15 insertions, 8 deletions
diff --git a/lib/general.lib.php b/lib/general.lib.php
index 6cce88b8..697e0f50 100644
--- a/lib/general.lib.php
+++ b/lib/general.lib.php
@@ -631,7 +631,7 @@ function get_global_popular($type) {
$artist_obj->format_artist();
$artist = $artist_obj->full_name;
$items[] = "<li> <a href=\"$web_path/artists.php?action=show&amp;artist=" . $r['object_id'] . "\" title=\"". scrub_out($artist) ."\">" .
- scrub_out(truncate_with_ellipse($artist, conf('ellipse_threshold_artist')+3)) . "&nbsp;(" . $r['count'] . ")</a> </li>";
+ truncate_with_ellipse($artist, conf('ellipse_threshold_artist')+3) . "&nbsp;(" . $r['count'] . ")</a> </li>";
} // if type isn't artist
/* If Album */
diff --git a/playlist.php b/playlist.php
index 126b3a68..41bed506 100644
--- a/playlist.php
+++ b/playlist.php
@@ -153,8 +153,14 @@ switch ($action) {
show_import_playlist();
break;
case 'import_playlist':
+ /* first we rename the file to it's original name before importing.
+ Otherwise the playlist name will have the $_FILES['filename']['tmp_name'] which doesn't look right... */
+ $dir = dirname($_FILES['filename']['tmp_name']) . "/";
+ $filename = $dir . basename($_FILES['filename']['name']);
+ move_uploaded_file($_FILES['filename']['tmp_name'], $filename );
+
$catalog = new Catalog();
- $catalog->import_m3u(scrub_in($_REQUEST['filename']));
+ $catalog->import_m3u($filename);
$url = conf('web_path') . '/playlist.php';
$title = _('Playlist Imported');
diff --git a/templates/show_import_playlist.inc.php b/templates/show_import_playlist.inc.php
index c4fd6284..8e0b8ceb 100644
--- a/templates/show_import_playlist.inc.php
+++ b/templates/show_import_playlist.inc.php
@@ -21,16 +21,16 @@
*/
?>
<form method="post" name="import_playlist" action="<?php echo conf('web_path'); ?>/playlist.php" enctype="multipart/form-data">
-<span class="header2"><?php echo _('Importing a Playlist from a File'); ?></span>
-<table border="0" cellpadding="0" cellspacing="0" class="border" style="border: 1px solid black;">
-<tr class="<?php echo flip_class(); ?>">
+<?php show_box_top(_('Importing a Playlist from a File')); ?>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr>
<td>
<?php echo _('Filename'); ?>:
<?php $GLOBALS['error']->print_error('filename'); ?>
</td>
- <td><input type="text" name="filename" value="<?php echo scrub_out($_REQUEST['filename']); ?>" size="45" /></td>
+ <td><input type="file" name="filename" value="<?php echo scrub_out($_REQUEST['filename']); ?>" size="45" /></td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr>
<td>
<?php echo _('Playlist Type'); ?>
</td>
@@ -41,7 +41,7 @@
</select>
</td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr>
<td>&nbsp;</td>
<td>
<input type="hidden" name="action" value="import_playlist" />
@@ -49,4 +49,5 @@
</td>
</tr>
</table>
+<?php show_box_bottom(); ?>
</form>