([\s\S]*)<\/div>/i',"[$1]$2[/$1]",$text); // verified
diff --git a/e107_handlers/media_class.php b/e107_handlers/media_class.php
index e3e882c96..f56faa673 100644
--- a/e107_handlers/media_class.php
+++ b/e107_handlers/media_class.php
@@ -535,7 +535,7 @@ class e_media
$img_url = ($cat !='_icon') ? e107::getParser()->thumbUrl($im['media_url'], $att) : $media_path;
- $text .= "
";
+ $text .= "";
$text .= "
";
$text .= "\n\n";
}
@@ -677,7 +677,7 @@ class e_media
$img_data['media_caption'] = $new_data['media_caption'];
$img_data['media_category'] = $category;
$img_data['media_description'] = $new_data['media_description'];
- $img_data['media_userclass'] = 0;
+ $img_data['media_userclass'] = '0';
if($sql->db_Insert("core_media",$img_data))
{
diff --git a/e107_plugins/tinymce/plugins/ibrowser/ibrowser.php b/e107_plugins/tinymce/plugins/ibrowser/ibrowser.php
index 3d69eee1f..9b7e8ff9f 100644
--- a/e107_plugins/tinymce/plugins/ibrowser/ibrowser.php
+++ b/e107_plugins/tinymce/plugins/ibrowser/ibrowser.php
@@ -23,7 +23,7 @@
// unset $tinyMCE_imglib_include
require_once("../../../../class2.php");
-header("Location: ".e_ADMIN_ABS.'image.php?mode=main&action=dialog&for='.$_SESSION['media_category'].'&tagid=&iframe=1&bbcode=1');
+header("Location: ".e_ADMIN_ABS.'image.php?mode=main&action=dialog&for='.$_SESSION['media_category'].'&tagid=&iframe=1&bbcode=img');
exit;
diff --git a/request.php b/request.php
index 7bfa67772..38fe8758a 100644
--- a/request.php
+++ b/request.php
@@ -30,6 +30,23 @@ if (!e_QUERY || isset($_POST['userlogin']))
}
$id = FALSE;
+
+//TODO e_request.php - allow plugins like 'downloads' to hook into request.php which should only be a generic file-downloading function.
+
+// Media-Manager direct file download.
+if(vartrue($_GET['file']) && is_numeric($_GET['file']))
+{
+ if ($sql->db_Select('core_media', 'media_url', "media_id= ".intval($_GET['file'])." AND media_userclass IN (".USERCLASS_LIST.") LIMIT 1 "))
+ {
+ $row = $sql->db_Fetch();
+ $file = $tp->replaceConstants($row['media_url'],'rel');
+ // echo 'file='.$file;
+ send_file($file);
+ exit();
+ }
+}
+
+
if (!is_numeric(e_QUERY))
{
if ($sql->db_Select('download', 'download_id', "download_url='".$tp -> toDB(e_QUERY)."'"))
@@ -51,6 +68,7 @@ if (!is_numeric(e_QUERY))
}
+
if(strstr(e_QUERY, "mirror"))
{ // Download from mirror
list($action, $download_id, $mirror_id) = explode(".", e_QUERY);
@@ -343,13 +361,17 @@ else
// File retrieval function. by Cam.
function send_file($file)
{
- global $pref, $DOWNLOADS_DIRECTORY,$FILES_DIRECTORY, $e107;
+ global $DOWNLOADS_DIRECTORY,$FILES_DIRECTORY, $e107;
+
+ $pref = e107::getPref();
+
+ /* PHP handling by default.
if (!$pref['download_php'])
{
header("Location: ".SITEURL.$file);
exit();
}
-
+ */
@set_time_limit(10 * 60);
@session_write_close();