Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: EmilioGaviria on February 12, 2024, 04:14:20 PM

Title: custom page - how to include smf bbcode editor
Post by: EmilioGaviria on February 12, 2024, 04:14:20 PM
lets just say I have textarea

something like this
<textarea name="description" id="description"  class="input_text"></textarea>
how do I add BBCode Editor?
Title: Re: custom page - how to include smf bbcode editor
Post by: Oldiesmann on February 12, 2024, 09:58:10 PM
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.
Title: Re: custom page - how to include smf bbcode editor
Post by: Arantor on February 13, 2024, 03:59:17 AM
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.