Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#8591 closed Bug (duplicate)

Bug with custom smilies(BBCode) with phpBB3

Reported by: Almog Baku Owned by:
Priority: Normal Milestone:
Component: Core : Output Data Version:
Keywords: Cc:

Description

Dear sir, Recently I have been developed a mod for phpBB who add your editor to the phpBB system(modx format).

The problem is that the custom smilies dosent works and when i click Source its stuck.

Attached the zip of the phpBB mod.

Yours, Almog Baku

*tried on the nightly ver and on the release ver.

The javascript at the posting page:

<script type="text/javascript" src="http://www.alpha.liorbarkan.com/phpBB3/lib/ckeditor/ckeditor.js"></script> <script type="text/javascript"> function CKEditor_for_phpBB_starter() {

CKEDITOR.replace("message", {

extraPlugins: 'bbcode', fontSize_sizes: 'קטנטן/50%;קטן/85%;רגיל/100%;גדול/150%;ענק/200%', toolbar: [

['Bold', 'Italic', 'Underline'], ['Undo', 'Redo'], ['NumberedList','BulletedList','-', 'Blockquote'],

['Image', 'Link', 'Unlink'],

['FontSize', 'TextColor' , 'Smiley'], Source?

], smiley_path: 'http://www.alpha.liorbarkan.com/phpBB3/images/smilies/', smiley_images: [

'icon_biggrin.gif','icon_smile.gif','icon_sad.gif','icon_surprised.gif','icon_eek.gif','icon_confused.gif','icon_cool.gif','icon_lol.gif','icon_mad.gif','icon_razz.gif','icon_redface.gif','icon_cry.gif','icon_evil.gif','icon_twisted.gif','icon_rolleyes.gif','icon_wink.gif','icon_exclaim.gif','icon_question.gif','icon_idea.gif','icon_arrow.gif','icon_neutral.gif','1luvu.gif','5000_p70099.gif','5000_p70105.gif','5000_p70150.gif','5000_p70153.gif','5000_p70157.gif','5000_p70158.gif','5000_p70159.gif'

], smiley_descriptions: [

'מאוד שמח','מחייך','עצוב','מופתע','המום','מבולבל','מגניב','צוחק','עצבני','חוצפן','מתבייש','בוכה או מאוד עצוב','רשע או מאוד עצבני','רשע מאוד','מגלגל עיניים','קורץ','סימן קריאה','סימן שאלה','רעיון','חץ','ללא הבעה','מאוהב','דופק את הראש בקיר','מסמיק','מה אתה קוקו?','בלון','תחתום','השטן','מתרפס אפיים ארצה'

]

}); document.getElementById("format-buttons").style.display = 'none'; document.getElementById("smiley-box").style.display = 'none'; document.getElementById("message-box").style.width = '100%';

} onload_functions.push('CKEditor_for_phpBB_starter()'); </script>

Attachments (1)

8591.html (2.6 KB) - added by Jakub Ś 8 years ago.
put it in _samples folder

Download all attachments as: .zip

Change History (7)

comment:2 Changed 8 years ago by Jakub Ś

Keywords: bug bbcode phpbb phpbb3 smily smilies removed
Resolution: duplicate
Status: newclosed
Version: 3.6.3 (SVN - trunk)

DUP of #8198

Changed 8 years ago by Jakub Ś

Attachment: 8591.html added

put it in _samples folder

comment:3 Changed 8 years ago by cke_aardbei

I also found the same issue when I added CKE to phpBB. I took a look at the BBcode plugin code (plugins\bbcode\plugin.js) and found that some RegExp special chars are not being escaped when the SmileyRexExp is built on line 94. I changed it to:

smileyRegExp.push( smileyMap[ i ].replace( /\(|\)|\:|\/|\?|\+|\$|\.|\^|\*|\-|\|/g, function( match ) { return '\\' + match; } ));

Small update - I have added a check that smiley_map has some content before it can be used.

I also added an extra config field (config.smiley_map) so that a custom smileyMap could be used which supports custom smileys. With the extra field I then changed line 86 to:

var smileyMap = (CKEDITOR.config.smiley_map&&CKEDITOR.config.smiley_map.length)||{"smiley":":)","sad":":(","wink":";)","laugh":":D","cheeky":":P","blush":":*)","surprise":":-o","indecision":":|","angry":">:(","angel":"o:)","cool":"8-)","devil":">:-)","crying":";(","kiss":":-*" },

This swaps the standard smileyMap for a custom map if one is defined.

I hope this helps someone out.

Cheers, Laurie

Last edited 8 years ago by cke_aardbei (previous) (diff)

comment:4 in reply to:  3 Changed 7 years ago by Almog Baku

+1 for this patch Replying to cke_aardbei:

I also found the same issue when I added CKE to phpBB. I took a look at the BBcode plugin code (plugins\bbcode\plugin.js) and found that some RegExp special chars are not being escaped when the SmileyRexExp is built on line 94. I changed it to:

smileyRegExp.push( smileyMap[ i ].replace( /\(|\)|\:|\/|\?|\+|\$|\.|\^|\*|\-|\|/g, function( match ) { return '\\' + match; } ));

Small update - I have added a check that smiley_map has some content before it can be used.

I also added an extra config field (config.smiley_map) so that a custom smileyMap could be used which supports custom smileys. With the extra field I then changed line 86 to:

var smileyMap = (CKEDITOR.config.smiley_map&&CKEDITOR.config.smiley_map.length)||{"smiley":":)","sad":":(","wink":";)","laugh":":D","cheeky":":P","blush":":*)","surprise":":-o","indecision":":|","angry":">:(","angel":"o:)","cool":"8-)","devil":">:-)","crying":";(","kiss":":-*" },

This swaps the standard smileyMap for a custom map if one is defined.

I hope this helps someone out.

Cheers, Laurie

comment:5 Changed 6 years ago by Dennis1993

Last edited 6 years ago by Dennis1993 (previous) (diff)

comment:6 Changed 6 years ago by Dennis1993

Hello,

the problem still exists. Another ticket: http://dev.ckeditor.com/ticket/10769

Please fix it in next version, because this error is very annoying. If I copy a text with a smiley and send it, the complete text is gone and I can retype the text!

My user cares about it. :-)

Thank you in advance!

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy