View Full Version : BB code tables 1.0 for vB 3.5.x
EvilHawk
01-19-2006, 10:00 PM
This plugin permits the creation of a table in a post! Tables support for thread postbit, post review and post preview!
This is a just port which is based on the original JohnWoo BB code tables 1.0 hack for vB 3.0.x (https://vborg.vbsupport.ru/showthread.php?t=72741) . This is posted with his permission. All credits to the original author!
How it works :
1) starting code is or [table 1 2 3] where
1 2 3 any numbers separated by space
first - border
second - cellpadding
third - cellspacing
- ending tag is always
- table lines separated by line break
- each line can have 7 styles. To specify a style add in the beginning number and ^ symbol without spaces
example:
2^
you may skip 7^ - it is default (alt1) style
- cells in line separated by |
- there is no need to add | before first and after last cell
- each cell can have each own align. Use align mark as a first symbol of cell without spaces
blank (default) - left
= - center
~ - right
- if number of cells different in lines, last cell of shorter lines will get colspan= with needed number
so table in post may look like
1|2|test 16798789789797979799879797979|4|5|6|7
1^~right with colspan
2^333|=center with colspan
3^1|2|left with colspan
4^1|=center without colspan|3|4|5|6|7
5^1|blablabla|3|4|5
6^1|2|3|4|5|6|7
Minor bugs:
a)It inserts an empty cell if you leave a space after the [table] tag, so the first line has to be like this
[table 1 3 0] 1|2|test 16798789789797979799879797979|4|5|6|7
b) you can not use other bbcodes or smilies inside the table tag as they will not get parsed...
You can see demos at the screenshots
-=Sniper=-
01-20-2006, 11:31 AM
very cool :) will be testing it out.
MioTraGusa
01-20-2006, 12:26 PM
very nice ... test it
nhacso
01-20-2006, 12:48 PM
- EvilHawk, how to add background color to "td" if don't use alt1 or alt2?
- You can add collapse / uncollapse images into to right of table?
Snake
01-20-2006, 01:06 PM
Good work and thanks!
EvilHawk
01-20-2006, 01:26 PM
- EvilHawk, how to add background color to "td" if don't use alt1 or alt2?
- You can add collapse / uncollapse images into to right of table?
It uses the template's css settings, so if you want to add extra colors there is no other way but to change the attributes at the functions the plugin uses!
Lea Verou
01-20-2006, 06:11 PM
Installed, thanks! :D
nhascso why would you want collapse/uncollapse images in posts??? :confused:
There is an obsession with collapse/uncollapse images by some people that I can't understand at all :confused:
nhacso
01-20-2006, 08:50 PM
Installed, thanks! :D
nhascso why would you want collapse/uncollapse images in posts??? :confused:
There is an obsession with collapse/uncollapse images by some people that I can't understand at all :confused:
Because if in a post I create 3 table -> if have collapse images will make the member easy discriminate between tables. And if 1 in 3 table have big and wide size make the posts in thread stretch -> if have collapse images will make the members easy zoom out that table. The end, will make the the post in thread look good better between the 2 normal others and will make the posts in thread not stretch.
ze_roberto
01-20-2006, 11:12 PM
Thank you, great hack :)
That helps us a lot for our editorial work...
cheers, ze
*clickin install
i love it :)
ChuckH
01-21-2006, 12:04 AM
Works great! Is there some reason why the first column in one of my tables has a green font? I don't have a green color in any of my styles.
ahmed-samara
01-21-2006, 12:07 AM
very nice ... test it
Detomah
01-21-2006, 01:07 AM
* Detomah officially installs it. ;)
I've been working on it to try and get it to show images and to try and get rid of that damn cell at the beginning of the table for the last few weeks on my site, but everythng i've tried so far has failed.
So, i'd been hoping it would get officially released.
Really hope someone elses brains can figure out the problem.
Lea Verou
01-21-2006, 12:22 PM
Well I mostly use it so I take care of the first cell thingy. :)
What bugs me the most is that some bbcodes inside the cells aren't parsed, eg images, attachments and who knows what more... and this problem will be much harder to fix than the first blank cell issue... :(
silurius
01-21-2006, 07:33 PM
Love it!
ChiliVB
01-25-2006, 06:43 PM
EvilHawk,
This plug-in is just what my organization has needed for some time. Thank you for your efforts!
As I understand it from a previous reply you made in this thread the td backgrounds are dependent on CSS. The Style 5 (beige) does not work on our forum, it appears as basic white. I checked the plugin values for style/class 5 and it says it is alt3.
We have very few custom modifications to our Default Style. Currently there are only 2 alternating colors defined, alt1 and alt2. Am I looking in the right place? I would like to be able to also use the beige style 5 background. as well as gray and white. I couldn't find an option to add an additional alternating color for the style.
Sorry for the rookie question! :ermm:
EvilHawk
01-29-2006, 08:15 AM
alt3 doesn't exists by default you can customize it as you like! ;)
Boofo
05-18-2006, 04:32 PM
Can this be set for as maximum width?
EvilHawk
05-19-2006, 11:39 AM
It does not stretch your postbit template, if that's you are asking sir.
Boofo
05-19-2006, 11:42 AM
Even on a fixed width? ;)
EvilHawk
05-19-2006, 12:36 PM
AFAIK yes (allthough i don't have a fixed width style to test it).
haris_led
07-21-2006, 01:22 PM
Dear EvilHawk, I think that it is better working with phrases! ;)
so, I changed the text in your xml, and I replaced it with some vbphrases :D
bb_table_title
bb_table_explanation
bb_table_example
bb_table_usage
so, by adding 4 phrases to the system, we can change or translate it easily :D
Here is what theese phrases should replace:
bb_table_title:
Table
bb_table_explanation:
Creates a table with parameters.
bb_table_example:
<br/>
1|2|test 16798789789797979799879797979|4|5|6|7<br/>
1^~right with colspan<br/>
2^333|=center with colspan<br/>
3^1|2|left with colspan <br/>
4^1|~center without colspan|3|4|5|6|7<br/>
5^1|blablabla|3|4|5<br/>
6^1|2|3|4|5|6|7<br/>
bb_table_usage:
table contents
starting code is or [table 1 2 3] where 1 2 3 any numbers separated by space (
first - border
second - cellpadding
third - cellspacing
- ending tag is always
- table lines separated by line break
- each line can have 7 styles. To specify a style add in the beginning number and ^ symbol without spaces example:2^ you may skip 7^ - it is default (alt1) style
- cells in line separated by |
- there is no need to add | before first and after last cell
- each cell can have each own align. Use align mark as a first symbol of ceil without spaces blank (default) - left
= - center
~ - right
- you can use any other BB code inside cells :)
- if number of ceils different in lines, last cell of shorter lines will get colspan= with needed number
I also include the new xml file(I just changed that part, nothing else:) )
haris_led
07-28-2006, 10:47 AM
Hello again, I think there is a bug!
When I type an url in a cell, and the system makes it a link with [url] tag, the link is wrong.
If the url is http://www.site.com, then the link will be: http://www.site.com\"/
What could it be?
abosaleh
08-02-2006, 08:02 AM
كفوا ا والله
thanksssss
ChuckH
08-08-2006, 07:41 PM
Hello again, I think there is a bug!
When I type an url in a cell, and the system makes it a link with [url] tag, the link is wrong.
If the url is http://www.site.com, then the link will be: http://www.site.com\"/
What could it be?
Just saw this myself. Doing the same thing.
EvilHawk
08-10-2006, 08:12 PM
I suggest to use this hack instead https://vborg.vbsupport.ru/showthread.php?t=107985
Dr.Vince
02-07-2007, 10:17 PM
Hello,
here's a code correction for bbcode (like url and image) working :
Replace all code like that (in modules) :
$this->post['message'] = preg_replace("~(\[table.+\[/table\])~iUse", "fetch_html_table('\\1')", $this->post['message']);
by :
preg_match("~(\[table.+\[/table\])~iUs", $this->post['message'], $matches);
$replace = fetch_html_table($matches[1]);
$this->post['message'] = preg_replace("~(\[table.+\[/table\])~iUs", $replace, $this->post['message']);
Explanation :
the e search option of preg_replace escape simple and double quote.
Selena Huynh
11-23-2009, 03:54 AM
it's great code but complicated in used. However, thanks for advance
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.