MyBB Community Forums

Full Version: Smilies are displayed as codes in WYSIWYG Editor Mode [+Solution]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
In WYSIWYG Editor mode, after inserting smilies, If any text is inserted into editor (or if any keys of keyboard is pushed), The smilie image is automatically converted to its source code! (Browser: Firefox)

[attachment=32216]

[attachment=32217]

Solution:

Open: inc/functions.php

Find:

					$onclick = ' onclick="console.log(MyBBEditor); MyBBEditor.insertText(\''.$smilie['find'].'\');"';


Replace:

					$onclick = ' onclick="console.log(MyBBEditor); MyBBEditor.insertText(\' '.$smilie['find'].' \');"';
You have to insert space before and after a smilie to show the image. That's how SCEditor works.
They are converted back when you push enter for example... maybe editor bug, it is not mybb related
(2014-08-19, 08:46 AM)Destroy666 Wrote: [ -> ]You have to insert space before and after a smilie to show the image. That's how SCEditor works.

(2014-08-19, 08:51 AM)Eldenroot Wrote: [ -> ]They are converted back when you push enter for example... maybe editor bug, it is not mybb related

No! Its not editor's bug because this problem occurs while using MyBB Smilie Inserter and There is no problem while using the editor's Smilie Inserter! 

The editor's Smilie Inserter automatically adds space before and after the smilie code and there's no problem.

I mean the MyBB Smilie Inserter must add these spaces too!

Solution:

Open: inc/functions.php

Find:
					$onclick = ' onclick="console.log(MyBBEditor); MyBBEditor.insertText(\''.$smilie['find'].'\');"';


Replace:
					$onclick = ' onclick="console.log(MyBBEditor); MyBBEditor.insertText(\' '.$smilie['find'].' \');"';
Yes, this solution is a working fix
Oh ok, it's indeed a bug then.

Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/1268

Thanks for contributing to MyBB!

Regards,
The MyBB Group
Thank you for your fix - I created a PR - https://github.com/mybb/mybb/pull/1269