Hi there,
How can I get bbcodes automaticly converted INSIDE THE TEXTAREA. So, like with vBulletin e.g., the text is already bold shown inside the textarea, or links are already shown as links inside the textarea, etc..
How to do this? Is it complex to accomplish?
Thanks in advanced! :)
Cheers.
BBcodes automaticly converted inside textarea
Started by webcodez, Apr 12 2010 06:31 AM
3 replies to this topic
#1
Posted 12 April 2010 - 06:31 AM
|
|
|
#2
Guest_Jaan_*
Posted 12 April 2010 - 07:06 AM
Guest_Jaan_*
yea man.. I think it wont be easy to make something like this.. You have to use some kind of javascript or jquery..
#3
Posted 12 April 2010 - 08:19 AM
Seems like I need a 'WYSIWYG' editor, and googled it: vBulletin uses htmlarea? They just use pre-made WYSIWYG editors from internet? o.O
EDIT: seems like I'll need to use a WYSIWYG editor like TinyMCE.
EDIT: seems like I'll need to use a WYSIWYG editor like TinyMCE.
#4
Posted 12 April 2010 - 11:06 AM
Trying out FCKeditor now but seem not to use BBCodes but only HTML codes instead. So what I just done was replacing them by bbcodes like this:
by
Though that would replace all <anythings> by [anythings] even when it's not meant to but I think people won't put things between < and > anyway but yeah, I could also make a list of all bbcodes and replace all those corresponding html codes with those but then I'm afraid for vulnerability as there might be html codes left or wouldn't that matter if I just use htmlspecialchars?
Would it be a 'good' way to just replace the html tags / codes by bbcodes? ( either all or only the existing/valid html/bbcodes )
Thanks in advanced.
btw, got it working but not sure if it isn't vulnerable.
EDIT: also seems that the editor automaticly puts this as code inside the textarea:
=/ all based on html codes... could just all change them by bbcodes and try remove this from standard code but not sure if that's the right way.
<(.*)>
by
[\$1]
Though that would replace all <anythings> by [anythings] even when it's not meant to but I think people won't put things between < and > anyway but yeah, I could also make a list of all bbcodes and replace all those corresponding html codes with those but then I'm afraid for vulnerability as there might be html codes left or wouldn't that matter if I just use htmlspecialchars?
Would it be a 'good' way to just replace the html tags / codes by bbcodes? ( either all or only the existing/valid html/bbcodes )
Thanks in advanced.
btw, got it working but not sure if it isn't vulnerable.
EDIT: also seems that the editor automaticly puts this as code inside the textarea:
<html> <head> <title></title> </head> <body></body> </html>
=/ all based on html codes... could just all change them by bbcodes and try remove this from standard code but not sure if that's the right way.


Sign In
Create Account


Back to top









