1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

Fixes #803 - TinyMce Image paths issue.

This commit is contained in:
Cameron
2015-01-29 17:01:52 -08:00
parent e279160039
commit bb01287e25
2 changed files with 25 additions and 4 deletions

View File

@@ -41,6 +41,7 @@ class bb_img extends e_bb_base
// 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_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);
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(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);
}

View File

@@ -38,6 +38,9 @@ if($_POST['mode'] == 'tohtml')
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.
{
e107::getBB()->clearClass();
@@ -46,12 +49,22 @@ if($_POST['mode'] == 'tohtml')
$content = nl2br($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]");
$content = str_replace($srch,"",$content);
$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.
{
@@ -63,6 +76,13 @@ if($_POST['mode'] == 'tohtml')
$content = $tp->toHtml($content, true);
$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;
}