diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index fb10d12b2..d576a74e7 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -16,14 +16,15 @@ if(!defined('e107_INIT')) require_once('../../class2.php'); } -if(USER) -{ - define('e_TINYMCE_TEMPLATE', 'member'); // allow images / videos. -} -else -{ - define('e_TINYMCE_TEMPLATE', 'public'); -} +// Now defined in shortcodes that handle the editors +// if(USER) +// { +// define('e_TINYMCE_TEMPLATE', 'member'); // allow images / videos. +// } +// else +// { +// define('e_TINYMCE_TEMPLATE', 'public'); +// } define('NAVIGATION_ACTIVE','forum'); // ?? diff --git a/e107_plugins/forum/shortcodes/batch/post_shortcodes.php b/e107_plugins/forum/shortcodes/batch/post_shortcodes.php index fbb752604..53a870207 100644 --- a/e107_plugins/forum/shortcodes/batch/post_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/post_shortcodes.php @@ -153,7 +153,13 @@ class plugin_forum_post_shortcodes extends e_shortcode { $tp = e107::getParser(); - + // Define which tinymce4 template should be used, depending if the current user is registered or a guest + if (!deftrue('e_TINYMCE_TEMPLATE')) + { + define('e_TINYMCE_TEMPLATE', (USER ? 'member' : 'public')); // allow images / videos. + } + + if(!empty($_POST['post'])) { $text = $tp->post_toForm($_POST['post']); @@ -182,7 +188,8 @@ class plugin_forum_post_shortcodes extends e_shortcode //$wysiwyg = ($editor === 'bbcode') ? false : null; $wysiwyg = is_null($editor) ? 'default' : $editor; - return e107::getForm()->bbarea('post',$text,'forum','_common','large', array('wysiwyg' => $wysiwyg)); + //return e107::getForm()->bbarea('post',$text,'forum','_common','large', array('wysiwyg' => $wysiwyg)); + return e107::getForm()->bbarea('post',$text,'forum','forum','large', array('wysiwyg' => $wysiwyg)); } diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php index 079e497db..cc5c14bb0 100644 --- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php @@ -1188,6 +1188,12 @@ { global $forum, $forum_quickreply; + // Define which tinymce4 template should be used, depending if the current user is registered or a guest + if (!deftrue('e_TINYMCE_TEMPLATE')) + { + define('e_TINYMCE_TEMPLATE', (USER ? 'member' : 'public')); // allow images / videos. + } + if($forum->checkPerm($this->var['thread_forum_id'], 'post') && $this->var['thread_active']) { //XXX Show only on the last page?? @@ -1224,7 +1230,8 @@ $text = "