![]() |
Custom BBCode / WYSIWYG
Hi
A few of you might know about my SBB forum software which I am making. Well, simply put, is there an easy way I can make my own bbcode with a simple WYSIWYG editor type thing (not important, could be just input buttons which when pressed enters part of a bbcode into the text box)? I have a static method; found on the internet: PHP Code:
Also could someone tell me how I would use the function nl2br to make it so that when the user makes a new line in the text box it puts a <br / > tag there? Gareth. |
What do you mean by run it through a query?
And as far as nl2br, say $text was the user's input, just use $text = nl2br($text); and it should work just fine. For a WYSIWYG editor, just have a row of buttons that, when clicked, adds that code to the text field. Most of the editors nowadays use Javascript, and I'm pretty sure thats the only way to do it without reloading the page. This might help: How to Create a WYSIWYG Rich Text Editor in JavaScript. Pt. 1 - WebReference.com- Hope that helped =) |
Do you mean run the
smilies function through the return results from the query? So in your case an individual's post. If that is what you're asking then that's perfectly acceptable. |
Yeah thats what I do on my site.
Pull the data from the database, run it through the smilies function, and then output it =) |
That's indeed what I did in the end.
And for the WYSIWYG editor I am going to use Mootools. |
Ooo MooTools. Is that such a good idea knowing how rubbish MooTools is? Personally speaking. I may be tempted to use Scriptalicious if you can.
|
Rubbish in what way? Security or..??
|
No no. Not security. I think it's just very bad in the way it implements things. I would consider it more of a scripting library than a programmers' library. But that's just my personal preference. MooTools just doesn't promote good coding practices from what I have witnessed of it.
|
I happen to have used it, and I quite like it. Some of its internal code might be sloppy, sure, but it is quite efficient and has the smoothest effects. To each their own.
|
| All times are GMT. The time now is 07:29 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0