mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 15:16:30 +02:00
Fixes #803 - TinyMce Image paths issue.
This commit is contained in:
@@ -41,6 +41,7 @@ class bb_img extends e_bb_base
|
|||||||
// Replace the bbcode path with a real one.
|
// Replace the bbcode path with a real one.
|
||||||
$code_text = str_replace('{e_MEDIA}','{e_MEDIA_IMAGE}',$code_text); //BC 0.8 fix.
|
$code_text = str_replace('{e_MEDIA}','{e_MEDIA_IMAGE}',$code_text); //BC 0.8 fix.
|
||||||
$code_text = str_replace('{e_MEDIA_IMAGE}', e_HTTP."thumb.php?src=e_MEDIA_IMAGE/", $code_text);
|
$code_text = str_replace('{e_MEDIA_IMAGE}', e_HTTP."thumb.php?src=e_MEDIA_IMAGE/", $code_text);
|
||||||
|
$code_text = str_replace('{e_THEME}', e_HTTP."thumb.php?src=e_THEME/", $code_text);
|
||||||
$imgParms = $this->processParm($code_text, $parm);
|
$imgParms = $this->processParm($code_text, $parm);
|
||||||
|
|
||||||
foreach($imgParms as $k => $v)
|
foreach($imgParms as $k => $v)
|
||||||
@@ -124,7 +125,7 @@ class bb_img extends e_bb_base
|
|||||||
|
|
||||||
if (trim($code_text) == "") return ""; // Do nothing on empty file
|
if (trim($code_text) == "") return ""; // Do nothing on empty file
|
||||||
|
|
||||||
if(substr($code_text,0,15) == '{e_MEDIA_IMAGE}') // Image from Media-Manager.
|
if(substr($code_text,0,15) == '{e_MEDIA_IMAGE}' || substr($code_text,0,9) == '{e_MEDIA}' || substr($code_text,0,9) == '{e_THEME}') // Image from Media-Manager.
|
||||||
{
|
{
|
||||||
return $this->mediaImage($code_text, $parm);
|
return $this->mediaImage($code_text, $parm);
|
||||||
}
|
}
|
||||||
|
@@ -38,6 +38,9 @@ if($_POST['mode'] == 'tohtml')
|
|||||||
if(check_class($pref['post_html'])) // raw HTML within [html] tags.
|
if(check_class($pref['post_html'])) // raw HTML within [html] tags.
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
// $content = $tp->replaceConstants($content,'abs');
|
||||||
|
|
||||||
if(strstr($content,"[html]") === false) // BC - convert old BB code text to html.
|
if(strstr($content,"[html]") === false) // BC - convert old BB code text to html.
|
||||||
{
|
{
|
||||||
e107::getBB()->clearClass();
|
e107::getBB()->clearClass();
|
||||||
@@ -46,12 +49,22 @@ if($_POST['mode'] == 'tohtml')
|
|||||||
$content = nl2br($content, true);
|
$content = nl2br($content, true);
|
||||||
$content = $tp->toHtml($content, true);
|
$content = $tp->toHtml($content, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = str_replace("{e_BASE}","",$content); // We want {e_BASE} in the final data going to the DB, but not the editor.
|
|
||||||
|
|
||||||
|
$content = str_replace("{e_BASE}",e_HTTP,$content); // We want {e_BASE} in the final data going to the DB, but not the editor.
|
||||||
$srch = array("<!-- bbcode-html-start -->","<!-- bbcode-html-end -->","[html]","[/html]");
|
$srch = array("<!-- bbcode-html-start -->","<!-- bbcode-html-end -->","[html]","[/html]");
|
||||||
$content = str_replace($srch,"",$content);
|
$content = str_replace($srch,"",$content);
|
||||||
$content = e107::getBB()->parseBBCodes($content); // parse the <bbcode> tag so we see the HTML equivalent while editing!
|
$content = e107::getBB()->parseBBCodes($content); // parse the <bbcode> tag so we see the HTML equivalent while editing!
|
||||||
echo $content;
|
|
||||||
|
if(!empty($content) && E107_DEBUG_LEVEL > 0)
|
||||||
|
{
|
||||||
|
$content = "-- DEBUG MODE ACTIVE -- \n".$content;
|
||||||
|
echo htmlentities($content)."\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $content;
|
||||||
}
|
}
|
||||||
else // bbcode Mode.
|
else // bbcode Mode.
|
||||||
{
|
{
|
||||||
@@ -63,6 +76,13 @@ if($_POST['mode'] == 'tohtml')
|
|||||||
$content = $tp->toHtml($content, true);
|
$content = $tp->toHtml($content, true);
|
||||||
$content = str_replace(e_MEDIA_IMAGE,"{e_MEDIA_IMAGE}",$content);
|
$content = str_replace(e_MEDIA_IMAGE,"{e_MEDIA_IMAGE}",$content);
|
||||||
|
|
||||||
|
if(!empty($content) && E107_DEBUG_LEVEL > 0)
|
||||||
|
{
|
||||||
|
echo "<!-- bbcode mode -->";
|
||||||
|
//print_r(htmlentities($content))."\n";
|
||||||
|
//exit;
|
||||||
|
}
|
||||||
|
|
||||||
echo $content;
|
echo $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user