1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Backward Compatibility fix for TinyMce editing.

This commit is contained in:
Cameron 2013-03-18 02:16:41 -07:00
parent 86d77fa58b
commit 53b84b91f9
3 changed files with 15 additions and 4 deletions

View File

@ -51,7 +51,7 @@ class bb_img extends e_bb_base
$w = e107::getBB()->resizeWidth(); // varies depending on the class set by external script. see admin->media-manager->prefs
$w = vartrue($imgParms['width']) ? intval($imgParms['width']) : vartrue(e107::getBB()->resizeWidth(),300);
$w = vartrue($imgParms['width']) ? intval($imgParms['width']) : vartrue(e107::getBB()->resizeWidth(),0);
// $h = vartrue($imgParms['height']) ? intval($imgParms['height']) : e107::getBB()->resizeHeight();
$resize = "&w=".$w; // Always resize - otherwise the thumbnailer returns nothing.

View File

@ -464,6 +464,7 @@ class e_bbcode
// return the class for a bbcode
function getClass($type='')
{
$ret = "bbcode-".$type;
if($this->class)
{

View File

@ -32,6 +32,16 @@ if($_POST['mode'] == 'tohtml')
if(check_class($pref['post_html'])) // raw HTML within [html] tags.
{
if(strstr($content,"[img]") || strstr($content, "[b]") || strstr($content, "[link")) // BC - convert old BB code text to html.
{
e107::getBB()->clearClass();
$content = str_replace('\r\n',"<br />",$content);
$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.
$srch = array("<!-- bbcode-html-start -->","<!-- bbcode-html-end -->","[html]","[/html]");
@ -61,11 +71,11 @@ if($_POST['mode'] == 'tobbcode')
if(check_class($pref['post_html'])) // Plain HTML mode.
{
$srch = array('src="'.e_HTTP.'thumb.php?');
$repl = array('src="{e_BASE}thumb.php?');
$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 = '/<img[^>]*src="{e_BASE}thumb.php\?src=([\S]*)w=([\d]*)&amp;h=([\d]*)"(.*)width="([\d]*)" height="([\d]*)"/i';