[BBcode] Script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

[BBcode] Script

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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)
Post Reply