The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
BBCode - Comprehensive set of TABLE tags (BB Code) Details »» | ||||||||||||||||||||||||||
BBCode - Comprehensive set of TABLE tags (BB Code)
Developer Last Online: Aug 2023
DO NOT USE on vBulletin 4.1.4 or above!
vBulletin 4.1.4 now includes built in support to the TABLE BB Code as part of the new editor. Installing this code will cause conflicts. If you have this installed, delete it before upgrading to 4.1.4! WARNING- USING THIS CAN BE A SECURITY RISK!!! Using this BB Code will allow people who know what they are doing to run arbitrary JavaScript in the code. For this reason I strongly recommend you limit the use of this BB Code to admins and trusted users (mods?) only! You can use the Advanced BB Code Permissions mod to limit this by usergroup. I have it installed on 4.0.8 and it's working well. Thanks to Kyo-Dono for pointing this out. [tbl],[tr],[td],[th] Demo URL: http://www.juot.net/forums/showthrea...497#post872497 This is a comprehensive set of codes for making HTML tables. If you're not familiar with HTML tables this code is probably not for you, if you are this should come in very handy. One of the main limitations of bulletin board software is the inability to put tables into posts. The existing [table] BB Code Mod helps but it is not easy to use and the interface isn't similar to traditional HTML tables. This set of table elements mimic traditional <html> tags and allow for advanced elements like background color, alignment, height and width attributes for any element. (The existing mod is here: https://vborg.vbsupport.ru/showthread.php?t=107985 you may prefer that to this.) All HTML tables are made up of at least 3 sets of HTML tags such as: <table><tr><td>Some Info Here</td></tr></table> Using this BB Code solution the syntax for the same would simply be: [tbl][tr][td]Some Info Here[/td][/tr][/tbl] Note "tbl" is being used instead of "table" to keep compatibility with the existing [table] BB Code. The code above gives a pretty boring table... Where this code really shines is that in any of those elements you can use the "option" part of the tag to add attributes to that element, so if you wanted to make the whole table light-blue you could use: [tbl="bgcolor=lightblue"][tr][td]Some Info Here[/td][/tr][/tbl] And if you wanted to make the cell 50 pixels high: [tbl="bgcolor=lightblue"][tr][td="height=50"]Some Info Here[/td][/tr][/tbl] There are many attributes you may be familiar with for HTML tables, all and any can be used in these tags. A more complicated table would be: [tbl="border=0 bgcolor=grey align=center"] [tr][th="bgcolor=lightblue colspan=3"][B]Table Header[/B][/th][/tr] [tr][td]:pirate:[/td][td="bgcolor=yellow"]:jump:[/td][td]:panic:[/td][/tr] [tr="bgcolor=pink height=50"][td]:sad:[/td][td]:owned:[/td][td]:thup2:[/td][/tr] [/tbl] As you can see you may use other BB Code's within these codes as well as smilies and images. There are many resources on the web for learning about HTML tables. This is one of many: http://www.quackit.com/html/codes/html_table_code.cfm To make this code work its magic we need to install 8 seperate BB Codes (6 if you don't care about table headers). For each code we want to install it both with and without an "option" attribute- this will make using the code easier when you have no options needed but let you use them anywhere they are needed. For the sake of simplicity I'm going to skip of few of the most basic steps, BB Codes are generally easy but please make sure you've installed a few before this one. You can call the tags anything you want, in my examples I used: tbl = <table> tag... (for compatibility if you have another [table] BB Code installed. tr = <tr> tag (Table Row) th = <th> tag (Table Header) td = <td> tag {Table Data or Cell) WARNING: If you have the 4.x SUITE there are already table bbcodes for the CMS portion of your site. Because of this you can not use [tr] or [td] as valid bbcode names because they are already in use. Please use something else such as [trr] and [tdd]. For the tags without options use the following replacements: [tbl] Code:
<table>{param}</table> Code:
<th>{param}</th> Code:
<tr>{param}</tr> Code:
<td>{param}</td> [tbl][tr][th]Header[/th][/tr][tr][td]test[/td][/tr][/tbl] Remember the example won't show correctly until every code in the set is installed. Add the following code replacements WITH Option- "Use Option = Enabled" [tbl] Code:
<table {option}>{param}</table> Code:
<th {option}>{param}</th> Code:
<tr {option}>{param}</tr> Code:
<td {option}>{param}</td> Disable Word Wrapping inside BB Code = Yes All Other Disable Options = No You will now be able to make complete HTML tables using the tags with or without options as needed. See the Demo above for this code in action. Please Mark as Installed if you use this. Download a copy of the .txt file as a backup. Download Now
Screenshots
Show Your Support
|
Comments |
#22
|
|||
|
|||
Right, not a very neat solution, but I suppose it will work for now. I really appreciate the quick reply, and you're right about having HTML turned off I'm pretty sure. To be honest I didn't even think about that. I'm going to look through vBulletin and try to hack a way for it to ignore line breaks between the [tbl] tags.
Also, reaaalllly looking forward to some updates on your [you] tag mod. I really love it. You might get some lols out of this thread. |
#23
|
|||
|
|||
What is with this code?
[td="bgcolor='yellow' onlick='alert('attacke!');'"] Is this code (only simple example) not a big security hole? |
#24
|
||||
|
||||
Quote:
Thank you for pointing this out- I will send an email to all people with this installed immediately and update the top post. |
#25
|
|||
|
|||
Mhh, I like you mod. I founded this mod https://vborg.vbsupport.ru/showthread.php?p=2139793 but its not original supported 4.1.0
What is with this ideas: create static styles and user can select what he want: styles add in additional.css [table1] => <table ... class="table1"> [table2] => <table ... class="table2"> [tr1] => <tr class="tr1"> [tr2] => <tr class="tr2"> [td1] => <td class="td1"> [td2] => <td class="td2"> or much better with own optional parameters in bbcode, when it is possible : [td span=2 class=td1 align=center] => <td colspan="2" class="td1" align="center"> I hope you understand |
#26
|
||||
|
||||
I understand you want the fixes included in post #670 in the other table bb code as an installable product... unfortunately since the code is put out by another coder who did not mark it as "re-usable" I can't release a 4.x version based on that code.
|
#27
|
|||
|
|||
My ideas are based not on the other mod. There were ideas for you to resolve the security problem. My example convert BBCode to HTML. Not simple include parameter in HTML.
|
#28
|
||||
|
||||
Now I understand... yes that would be a good way to do it but would add even more BB Codes to the mix.
|
#29
|
|||
|
|||
I'm new with vbulletin and have not installed your mod.
Is my simple javascript example really working? Have you test it? I have insert custom bbcode in my forum and " or ' is converting (vB4.1) in secure HTML-Entities. So is it or not a security risk? |
#30
|
||||
|
||||
Your exact code didn't work but I made some changes and did get the alert box to show. I tested it on 4.0.8 which is the latest version I have access to. If you only want to use the tbl tag as an administrator you can block other people from using it using the "Advanced BB Code permissions" mod I linked to.
|
#31
|
|||
|
|||
What code did you run the javascript?
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|