News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

custom page - how to include smf bbcode editor

Started by EmilioGaviria, February 12, 2024, 04:14:20 PM

Previous topic - Next topic

EmilioGaviria

lets just say I have textarea

something like this
<textarea name="description" id="description"  class="input_text"></textarea>
how do I add BBCode Editor?

Oldiesmann

See the quick start part here: https://www.sceditor.com/. You will need to change the URL for the javascript and CSS files to use the ones in SMF though, and change the id in the code to match the id of your textarea.
Michael Eshom
Christian Metal Fans

Arantor

Inside SMF you need to load Subs-Editor.php and call create_control_richedit() with the right options. See Display.php for a simpler example of this.

Then on saving I forget the exact order but I think you htmlspecialchars the spring (using smcFunc's version) then preparsecode() it then save it to the database.

Advertisement: