MyBB Community Forums

Full Version: FckEditor WYSIWYG integration for HTML Enabled forums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings all,

I haven't seen any traffic talking about integrating Fckeditor into mybb. As I've recently done so on my 1.2.13 boards I thought I'd share how easy it was.

First off, I can tell you that it is incredibly easy to do and you do not need to be a programer to do it (I'm not one). You just download the editor, unzip it to your mybb root, and then paste a small snippet of code into about 6 templates. It's that easy.

Second, for those of you that already use Hoteditor, I can tell you that Fckeditor provides a MUCH better result when dealing with things like word documents or any other items coming out of MS word.

OK, here we go.

1. Download the tool here:
http://www.fckeditor.net/

2. Unzip it to your mybb root. (You can also put it in your webroot if you plan use it for other applications as well).

Now you are going to do a simple edit of about 6 of your default templates.

I'm going to use some of the documentation from Hoteditor here because I don't feel like retyping it.
----------------------------------------------------------------
You're almost done. You have to follow these steps below to MODIFY your current templates in order to make it works with fckeditor.

+ Login to your Admin Control Panel
+ You're going to use Admin Control Panel to Modify your current Template.
Before you do that, you must know which Theme is a default Theme

TIP: Look at the Admin Control Panel Menu (left hand side frame) - scroll down to section [Themes] - Click link Modify / Delete
and look for something like this: xxxx (Default) - For example if you see MyBB Default (Default) - that means "MyBB Default" is a defaul Theme

# Now, look at the Admin Control Panel Menu (left hand side frame) - inside Templates box - click link Modify / Delete
# If MyBB Default is your default theme then click Expand button. #
# You will see Template Management for Default Templates#
# We are going to edit 6 original templates
----------------------------------------------------------------

Now open the template named 'editpost'

Paste the following after the top <head> tags:

</script><script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'message' ) ;
oFCKeditor.BasePath = "/mybb/fckeditor/" ;
oFCKeditor.ReplaceTextarea() ;
}
</script>

Then scroll down about half way through the code and remove the following:

{$codebuttons}

One template down, and now that you see the process, repeat this process for the 'newreply' , 'newthread' ,and 'private_send' templates.

Next open the 'showthread_quickreply' template. Here you just place the code at the very top of the template and there is no 'codebutton' section to remove.

The 'usercp_editsig' template is very similar, just place the following inside the top 'head' tags. There is no 'codebutton' section:

<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'signature' ) ;
oFCKeditor.BasePath = "/mybb/fckeditor/" ;
oFCKeditor.ReplaceTextarea() ;
}
</script>


That should be it! Don't believe that I've left anything out, but if I have it would be pretty obvious.

I hope this helps out anyone that uses it. I'm sorry the post is so long (and a little meanderingSmile

cheers
Thank you. I will translate this thread to Turkish because our forum members want to use an advanced editor...
(2008-07-04, 05:38 PM)arno Wrote: [ -> ]Thank you. I will translate this thread to Turkish because our forum members want to use an advanced editor...

my pleasure!
Nice as a lot of people want this as a feature for MyBB. Are you thinking about making it into a plugin?
this is interesting maybe I will disable Hoteditor and use it in mybb 1.213

is there any security advice before enable HTML to all users? or it´s safe anyway?
Exclude a few tags if possible like iframes and what not so they can't abuse it.