mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 15:46:44 +02:00
TinyMce Youtube plugin fix and better BC check in parser.
This commit is contained in:
@@ -35,19 +35,17 @@ 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.
|
||||||
{
|
{
|
||||||
// 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();
|
e107::getBB()->clearClass();
|
||||||
|
|
||||||
$content = str_replace('\r\n',"<br />",$content);
|
$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 = $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}","",$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!
|
||||||
|
@@ -12,7 +12,7 @@ e107::css('inline',"
|
|||||||
.sizeblock { display:inline-block; width: 180px; margin:6px; font-size:14px}
|
.sizeblock { display:inline-block; width: 180px; margin:6px; font-size:14px}
|
||||||
input[type='radio'] { vertical-align: middle; padding-right:10px; }
|
input[type='radio'] { vertical-align: middle; padding-right:10px; }
|
||||||
.e-footer-info { color: silver }
|
.e-footer-info { color: silver }
|
||||||
body { background-color: #EEEEEE }
|
|
||||||
label { vertical-align:middle; line-height:12px}
|
label { vertical-align:middle; line-height:12px}
|
||||||
");
|
");
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ $(document).ready(function()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var html = '<iframe width=\"'+ w +'\" height=\"'+ h +'\" src=\"http://www.youtube.com/embed/YNrn-7zjmYw\" frameborder=\"0\" allowfullscreen></iframe>';
|
var html = '<iframe width=\"'+ w +'\" height=\"'+ h +'\" src=\"http://www.youtube.com/embed/' + code + '\" frameborder=\"0\" allowfullscreen></iframe>';
|
||||||
|
|
||||||
tinyMCEPopup.editor.execCommand('mceInsertContent', false, html);
|
tinyMCEPopup.editor.execCommand('mceInsertContent', false, html);
|
||||||
tinyMCEPopup.close();
|
tinyMCEPopup.close();
|
||||||
|
Reference in New Issue
Block a user