diff --git a/e107_admin/cache.php b/e107_admin/cache.php index 3e98adf17..730fa6f99 100644 --- a/e107_admin/cache.php +++ b/e107_admin/cache.php @@ -130,7 +130,7 @@ $text = "
".$content.""; - echo $content; - exit; - } - - - echo $content; - - } - else // bbcode Mode. - { - - // XXX @Cam this breaks new lines, currently we use \n instead [br] - //echo $tp->toHtml(str_replace("\n","",$content), true); - - $content = str_replace("{e_BASE}",e_HTTP, $content); // We want {e_BASE} in the final data going to the DB, but not the editor. - $content = $tp->toHtml($content, true); - $content = str_replace(e_MEDIA_IMAGE,"{e_MEDIA_IMAGE}",$content); - - if(!empty($content) && E107_DEBUG_LEVEL > 0) - { - echo ""; - //print_r(htmlentities($content))."\n"; - //exit; - } - - echo $content; - } - - e107::getBB()->clearClass(); -} - -if($_POST['mode'] == 'tobbcode') -{ - // echo $_POST['content']; - $content = stripslashes($_POST['content']); - - if(check_class($pref['post_html'])) // Plain HTML mode. - { - $srch = array('src="'.e_HTTP.'thumb.php?','src="/{e_MEDIA_IMAGE}'); - $repl = array('src="{e_BASE}thumb.php?','src="{e_BASE}thumb.php?src=e_MEDIA_IMAGE/'); - $content = str_replace($srch, $repl, $content); - - // resize the thumbnail to match wysiwyg width/height. - - // $psrch = '/
[/html] - { - exit; - } - - echo $content ? "[html]".$content."[/html]" : ""; // Add the tags before saving to DB. - } - else // bbcode Mode. //XXX Disabled at the moment in tinymce/e_meta.php - post_html is required to activate. - { - // [img width=400]/e107_2.0/thumb.php?src={e_MEDIA_IMAGE}2012-12/e107org_white_stripe.png&w=400&h=0[/img] - // $content = str_replace("{e_BASE}","", $content); // We want {e_BASE} in the final data going to the DB, but not the editor. - - echo e107::getBB()->htmltoBBcode($content); // not reliable enough yet. - } - -} - -/** - * Rebuld
".$content.""; + $text = $content; + return $text; + // exit; + } + else + { + $text = $content; + } + + + + } + else // bbcode Mode. + { + + // XXX @Cam this breaks new lines, currently we use \n instead [br] + //echo $tp->toHtml(str_replace("\n","",$content), true); + + $content = str_replace("{e_BASE}",e_HTTP, $content); // We want {e_BASE} in the final data going to the DB, but not the editor. + $content = $tp->toHtml($content, true); + $content = str_replace(e_MEDIA_IMAGE,"{e_MEDIA_IMAGE}",$content); + + $text = ""; + if(!empty($content) && E107_DEBUG_LEVEL > 0) + { + $text .= ""; + //print_r(htmlentities($content))."\n"; + //exit; + } + + $text .= $content; + } + + e107::getBB()->clearClass(); + return $text; + + } + + + + function toBBcode($content) + { + // echo $_POST['content']; + global $pref, $tp; + $content = stripslashes($content); + + if(check_class($pref['post_html'])) // Plain HTML mode. + { + $srch = array('src="'.e_HTTP.'thumb.php?','src="/{e_MEDIA_IMAGE}'); + $repl = array('src="{e_BASE}thumb.php?','src="{e_BASE}thumb.php?src=e_MEDIA_IMAGE/'); + $content = str_replace($srch, $repl, $content); + + // resize the thumbnail to match wysiwyg width/height. + + // $psrch = '/
[/html] + { + exit; + } + + $text = $content ? "[html]".$content."[/html]" : ""; // Add the tags before saving to DB. + } + else // bbcode Mode. //XXX Disabled at the moment in tinymce/e_meta.php - post_html is required to activate. + { + // [img width=400]/e107_2.0/thumb.php?src={e_MEDIA_IMAGE}2012-12/e107org_white_stripe.png&w=400&h=0[/img] + // $content = str_replace("{e_BASE}","", $content); // We want {e_BASE} in the final data going to the DB, but not the editor. + + $text = e107::getBB()->htmltoBBcode($content); // not reliable enough yet. + } + + return $text; + + } + + + /** + * Rebuld