mirror of
https://github.com/e107inc/e107.git
synced 2025-10-12 21:45:11 +02:00
TinyMce Youtube plugin fix and better BC check in parser.
This commit is contained in:
@@ -32,25 +32,23 @@ if($_POST['mode'] == 'tohtml')
|
||||
|
||||
// $content = e107::getBB()->htmltoBBcode($content); //XXX This breaks inserted images from media-manager. :/
|
||||
e107::getBB()->setClass($_SESSION['media_category']);
|
||||
|
||||
if(check_class($pref['post_html'])) // raw HTML within [html] tags.
|
||||
|
||||
if(check_class($pref['post_html'])) // raw HTML within [html] tags.
|
||||
{
|
||||
// Quick and dirty.
|
||||
if(strstr($content,"[img]") || strstr($content, "[b]") || strstr($content, "[link") || strstr($content, "[youtube")) // BC - convert old BB code text to html.
|
||||
|
||||
if(strstr($content,"[html]") === false) // BC - convert old BB code text to html.
|
||||
{
|
||||
e107::getBB()->clearClass();
|
||||
|
||||
$content = str_replace('\r\n',"<br />",$content);
|
||||
$content = nl2br($content, true);
|
||||
$content = nl2br($content, true); // replace any that were missed.
|
||||
$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.
|
||||
|
||||
$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!
|
||||
$content = str_replace("{e_BASE}","",$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;
|
||||
}
|
||||
else // bbcode Mode.
|
||||
|
Reference in New Issue
Block a user