Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: SMiFFER on October 11, 2018, 04:12:13 AM

Title: BBCode Tables
Post by: SMiFFER on October 11, 2018, 04:12:13 AM
Hey SMF-friends.

Waiting for the new 2.1 takes long so I puzzle a bit with mods and here... TABLES!

Is there such thing as DESCRIBED HERE for SMF? (https://www.phpbb.com/community/viewtopic.php?t=2355506#p14328421).

I find it particularly interesting that even colors and borders are showing in simple BBCode.

Any input on this?
Title: Re: BBCode Tables
Post by: Arantor on October 11, 2018, 04:17:41 AM
Not without a fairly large retooling of the existing table bbcode. Tables exist along with tr and to bbcode but there is a piece of code that tries to fix tags if it thinks they don't line up correctly or have proper matching end tags.

This code blows up spectacularly every time anyone tried to change it to support nice tables.

I think someone did do a mod a while ago where it just bypassed the table tags entirely and had a new tag name so the existing sanitiser doesn't see it.
Title: Re: BBCode Tables
Post by: aegersz on October 12, 2018, 05:47:11 PM
i use dougie's Custom BBCode Manager (http://custom.simplemachines.org/mods/index.php?mod=3699)  to quickly create new BBCodes.

just follow the documentation in that link to create the new BBCode & HTML pairs whilst carefully noting how arguments (content) get parsed so you can choose the right format when running the mod.

i had to fix a couple of bugs so see the comments about the mod.
Title: Re: BBCode Tables
Post by: aegersz on October 13, 2018, 03:06:23 AM
here is one that i tried to knock up quickly but was troubled with automatic insertion of <a href="..." </a> tags so  i am stripping the "http://" for simplicity (can't figure out a better way)

[audio=mpeg]128.199.200.202/private/100115 Feisty v Rollins Q Ball Mix.mp3[/audio]

see the attachments for the config of this and the icon:
Title: Re: BBCode Tables
Post by: aegersz on October 13, 2018, 03:53:39 AM
the "th" BBCode doesn't come with SMF so you have to build it.

this just displays as is:

[th]{TEXT}[/th]

but this HTML does what you posted:

[html]<table class="bbc_table"><tr><td>[th]Name[/th]<br />[th]Age[/th]<br /></td></tr><tr><td>John</td><td>65</td></tr><tr><td>Gitte</td><td>40</td></tr><tr><td>Sussie</td><td>19</td></tr></table>
[/html]