Page 1 of 1
[BBcode] Script
Posted: Wed Feb 08, 2006 12:05 pm
by seodevhead
Is there a script out there or code examples that will show developers how they can add buttons above their form textboxes that will automatically insert the proper BBcode tags in the <textarea> elements? I am talking about the buttons like 'B', 'i', 'Img', 'Code'? Thanks.
Posted: Wed Feb 08, 2006 12:16 pm
by feyd
in what context? outside of phpbb, or inside?
Outside, you need only have the buttons along with their support Javascript for them to work. It is included in the posting pages, if you want it.
Inside, there are mods such as MultiCode/MultiBBCode (I can't remember the exact name) that make it easier to add additional buttons to perform extra actions.
The processing intensity can vary however. If nesting is allowed of the same tag type, it gets a lot more complicated to process (using regular expressions anyways). If you want to see how phpbb does it, download at version and find bbcode.php in the includes directory. It has all the bbcode processing functions there (although it is hard to follow at times)