diff --git a/admin/bm.php b/admin/bm.php index 5f42047..f8a008e 100755 --- a/admin/bm.php +++ b/admin/bm.php @@ -149,7 +149,7 @@ if ($user->isAdmin()) { } ?>

 

-
name="frmAdd" class="newpost"> + name="frmAdd" class="newpost">
isAdmin()) { $input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}"); $output = array("7", $date, $_SESSION['user_id'], $url, $body); - $template->cargarPlantilla($input, $output, "template_add_mp3"); + $template->cargarPlantilla($input, $output, "template_add_mp3_bm"); $template->mostrarPlantilla(); break; } ?> diff --git a/admin/index.php b/admin/index.php index 5ff1cf0..ccb8540 100755 --- a/admin/index.php +++ b/admin/index.php @@ -60,15 +60,22 @@ if ($user->isAuthenticated()) { } if ($_POST["type"]=="7") { // is MP3 type - set_time_limit(300); - $mp3Name = $util_class->getFileName($_POST["url"]); - if (!$tumble->saveMP3($_POST["url"])) { - header("Location: ".$conf->urlSorbet."/admin/index.php?mp3=false"); - die(); - } - if ($util_class->isMP3($remoteFileName)) { - $_POST["url"] = $conf->urlSorbet."/uploads/".$mp3Name; + set_time_limit(300); + if (isset($_POST["url"]) && $_POST["url"]!="") { + $mp3Name = $util_class->getFileName($_POST["url"]); + if (!$tumble->saveMP3($_POST["url"])) { + header("Location: ".$conf->urlSorbet."/admin/index.php?mp3=false"); + die(); + } + $_POST["url"] = $conf->urlSorbet."/uploads/".$mp3Name; + } + + if (move_uploaded_file($_FILES['mp3']['tmp_name'], "../uploads/".$util_class->sanitizeName($_FILES['mp3']['name']))) { + $_POST["url"] = $conf->urlSorbet."/uploads/".$util_class->sanitizeName($_FILES['mp3']['name']); } + + unset($_POST["mp3"]); + unset($_POST["MAX_FILE_SIZE"]); } if (!get_magic_quotes_gpc()) { @@ -178,6 +185,7 @@ if ($user->isAuthenticated()) { $_GET['new'] = 'post'; } + $form = new themes; $form->set('date', $date); $form->set('id_user', $_SESSION['user_id']); diff --git a/admin/themes/admin/index.htm b/admin/themes/admin/index.htm index e012f64..5260a10 100755 --- a/admin/themes/admin/index.htm +++ b/admin/themes/admin/index.htm @@ -70,7 +70,7 @@ {if $action.deleted or $action.modified or $action.added}
{exito}
{/if} {if $error}
{error}
{/if} - +
{if $postId}{/if} {form} diff --git a/admin/themes/admin/template_add_mp3.htm b/admin/themes/admin/template_add_mp3.htm index 49c03b3..37d8486 100755 --- a/admin/themes/admin/template_add_mp3.htm +++ b/admin/themes/admin/template_add_mp3.htm @@ -1,35 +1,76 @@ - -
- -
-
- This is the MP3 file URL or a GoEar URL or an Odeo URL.
- (ie. http://www.goear.com/listen.php?v=c0a2c85) -
-
-
-
- -
- - - - + +
+ +
+
+ Supports MP3.  Max size is 10 MB. +
+ +
+ +
+ +
+ +
+ +
+ + +
+ + + + + + + + \ No newline at end of file + + $("#mp3_upload a.linkFrm").click( function() { + $('#mp3_upload').css('display','none'); + $('#mp3_url').css('display','block'); + $('#mp3').val(''); + return false; + } + ); + + $("#mp3_url a.linkFrm").click( function() { + $('#mp3_url').css('display','none'); + $('#mp3_upload').css('display','block'); + $('#url').val(''); + return false; + } + ); + + diff --git a/admin/themes/admin/template_add_mp3_bm.htm b/admin/themes/admin/template_add_mp3_bm.htm new file mode 100755 index 0000000..c00bde5 --- /dev/null +++ b/admin/themes/admin/template_add_mp3_bm.htm @@ -0,0 +1,68 @@ + +
+ +
+ +
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + diff --git a/classes/sorbet.class.php b/classes/sorbet.class.php index 005df52..7ff6a67 100755 --- a/classes/sorbet.class.php +++ b/classes/sorbet.class.php @@ -155,6 +155,7 @@ class sorbet public function saveMP3($remoteFileName) { + $util_class = new util(); if ($util_class->getMP3File($remoteFileName)) { return true; } else { @@ -164,6 +165,7 @@ class sorbet public function savePhoto($remoteFileName) { + $util_class = new util(); if ($util_class->getPhotoFile($remoteFileName)) { return true; } else { @@ -201,9 +203,10 @@ class sorbet } public function getMp3Player($url) { + $util_class = new util(); + $global_url = $this->conf->urlSorbet; if ($util_class->isMP3($url)) { - $playerUrl = $conf->urlSorbet."/admin/scripts/player.swf?soundFile=".$url; - return "\t\t\t\n"; + return "\t\t\t\n"; } elseif ($util_class->isGoEar($url)) { return "\t\t\tgetGoEarCode($url)."\" />\n"; } elseif ($util_class->isOdeo($url)) { diff --git a/themes/SorbetDark/index.htm b/themes/SorbetDark/index.htm old mode 100644 new mode 100755 index 3fa0c8b..dca4bd5 --- a/themes/SorbetDark/index.htm +++ b/themes/SorbetDark/index.htm @@ -185,7 +185,7 @@ diff --git a/themes/SorbetLight/index.htm b/themes/SorbetLight/index.htm old mode 100644 new mode 100755 index 3fa0c8b..dca4bd5 --- a/themes/SorbetLight/index.htm +++ b/themes/SorbetLight/index.htm @@ -185,7 +185,7 @@