#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)
Change History (7)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Keywords: | bug bbcode phpbb phpbb3 smily smilies removed |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Version: | 3.6.3 (SVN - trunk) |
DUP of #8198
comment:3 follow-up: 4 Changed 13 years ago by
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:4 Changed 13 years ago by
+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:6 Changed 11 years ago by
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!
file's size is too big. Please download from here: http://www.phpbb.co.il/download/file.php?id=1291 (from http://www.phpbb.co.il/viewtopic.php?f=23&t=26669&p=137959#p137959)