3.2 BBCode for tables?

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Mneme
Registered User
Posts: 13
Joined: Tue Aug 28, 2012 9:13 pm

3.2 BBCode for tables?

Post by Mneme » Wed Apr 05, 2017 9:15 pm

On 3.1 I had four custom BBCodes for a simple table: TABLE, TR, TD, and TDC. None of these now work. How should I rewrite these?

Code: Select all

[table]{TEXT}[/table]

<table style="width:100%;display:inline-table;border:#333333 solid 1px;background:#000000"><!-- {TEXT} --></table>

[tr]{TEXT}[/tr]

tr --><tr><!-- {TEXT} --></tr><!-- tr

[td]{TEXT}[/td]

td --> <td valign=top style="border-top:1px solid #111111; border-right:1px solid #111111;  border-left:1px solid #111111; padding:1px; margin:1px; border-radius:5px">{TEXT}</td> <!-- td

[tdc={NUMBER}]{TEXT}[/tdc]

td --> <td valign=top colspan={NUMBER} style="padding:1px; margin:1px; border-bottom:1px solid #111111; border-right:1px solid #111111;  border-left:1px solid #111111; border-radius:5px">{TEXT}</td> <!-- td
Last edited by Mneme on Sun Apr 30, 2017 5:01 pm, edited 1 time in total.

infinitiv
Registered User
Posts: 166
Joined: Sat Nov 15, 2014 3:47 pm
Location: PL
Name: Ficjusz

Re: 3.2 BBCode for tables?

Post by infinitiv » Wed Apr 05, 2017 10:43 pm

AFAIK 3.2 changed nothing in BBCode manager.

User avatar
JoshyPHP
Code Contributor
Posts: 1025
Joined: Mon Jul 11, 2011 12:28 am

Re: 3.2 BBCode for tables?

Post by JoshyPHP » Thu Apr 06, 2017 2:30 am

Remove all of the comment hacks and it should work fine.

Code: Select all

[table]{TEXT}[/table]

<table style="width:100%;display:inline-table;border:#333333 solid 1px;background:#000000">{TEXT}</table>

[tr]{TEXT}[/tr]

<tr>{TEXT}</tr>

[td]{TEXT}[/td]

<td valign=top style="border-top:1px solid #111111; border-right:1px solid #111111;  border-left:1px solid #111111; padding:1px; margin:1px; border-radius:5px">{TEXT}</td>

[tdc={NUMBER}]{TEXT}[/tdc]

<td valign=top colspan={NUMBER} style="padding:1px; margin:1px; border-bottom:1px solid #111111; border-right:1px solid #111111;  border-left:1px solid #111111; border-radius:5px">{TEXT}</td>
I wrote the thing that does BBCodes in 3.2.

User avatar
AmigoJack
Registered User
Posts: 5609
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: 3.2 BBCode for tables?

Post by AmigoJack » Thu Apr 06, 2017 6:49 am

JoshyPHP wrote:
Thu Apr 06, 2017 2:30 am
Remove all of the comment hacks
Why? As in: "why is that a requirement? The comments are there to allow newlines between BBCodes, you know."
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
JoshyPHP
Code Contributor
Posts: 1025
Joined: Mon Jul 11, 2011 12:28 am

Re: 3.2 BBCode for tables?

Post by JoshyPHP » Thu Apr 06, 2017 7:00 am

You can use all the comments you want, but that's what you get: comments. You put text in a comment, you get a comment. If you use <!-- {TEXT} --> that's what you'll get: all of the text inside of a comment.

In addition, those BBCodes try to open comments without closing them. That's a liability because an unterminated comment could disable a big part—or even all—of the markup that follows, potentially rendering the page unusable.
I wrote the thing that does BBCodes in 3.2.

User avatar
AmigoJack
Registered User
Posts: 5609
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: 3.2 BBCode for tables?

Post by AmigoJack » Thu Apr 06, 2017 8:44 am

JoshyPHP wrote:
Thu Apr 06, 2017 7:00 am
You can use all the comments you want, but that's what you get: comments. You put text in a comment, you get a comment. If you use <!-- {TEXT} --> that's what you'll get: all of the text inside of a comment.
I fear you neither understood my reply, nor that "comment" is not final: in <table><!-- {TEXT} --></table> the text itself can start with --><tr><!-- {TEXT} --></tr><!-- again (and so on). If you don't use comments in the substitution you're doomed to use the BBCodes like this:

Code: Select all

[table][tr][td]one[/td][td]two[/td][/tr][tr][td]eins[/td][td]zwei[/td][/tr][/table]
But with comments, you're free to do this:

Code: Select all

[table]
 [tr]
  [td]one[/td]
  [td]two[/td]
 [/tr][tr]
  [td]eins[/td]
  [td]zwei[/td]
 [/tr]
[/table]
What's the difference? phpBB turns newlines into <br/> - and those aren't allowed within <table> and <tr>.

JoshyPHP wrote:
Thu Apr 06, 2017 7:00 am
try to open comments without closing them
In the means of abuse: yes, this is a downside.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
JoshyPHP
Code Contributor
Posts: 1025
Joined: Mon Jul 11, 2011 12:28 am

Re: 3.2 BBCode for tables?

Post by JoshyPHP » Thu Apr 06, 2017 9:10 am

Nah, I understood what you said just fine, it's just that what you said is wrong. You can put as much whitespace between those BBCodes as you want, you won't get spurious blank lines in the output. I understand that some people chose to add half a comment here, half a comment there as a hack to hide <br> elements in the output but as I mentioned it can be used to break the layout in 3.1 and it's unnecessary in 3.2.

In short, the two code blocks you posted produce the same output in 3.2; No need for comments.
I wrote the thing that does BBCodes in 3.2.

User avatar
AmigoJack
Registered User
Posts: 5609
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: 3.2 BBCode for tables?

Post by AmigoJack » Thu Apr 06, 2017 10:35 am

JoshyPHP wrote:
Thu Apr 06, 2017 9:10 am
the two code blocks you posted produce the same output in 3.2
This is horrible: you mean when I cascade custom BBCodes all newlines are trimmed? On top that would mean your initial advice to remove comments would not change anything to this:
Mneme wrote:
Wed Apr 05, 2017 9:15 pm
None of these now work.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
JoshyPHP
Code Contributor
Posts: 1025
Joined: Mon Jul 11, 2011 12:28 am

Re: 3.2 BBCode for tables?

Post by JoshyPHP » Thu Apr 06, 2017 10:40 am

You clearly haven't made the effort to try it yourself and you're just wasting my time. I'm going to put you on my ignore list so you don't waste it further.
I wrote the thing that does BBCodes in 3.2.

User avatar
AmigoJack
Registered User
Posts: 5609
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: 3.2 BBCode for tables?

Post by AmigoJack » Thu Apr 06, 2017 11:06 am

That's a remarkable move. For all others:
  1. I also see no reason why the topic author's codes should not bring the expected results - nobody proved otherwise, nobody reproduced it.
  2. I know that my two BBCode examples will result in the same output, at least with 3.0 and 3.1 and HTML comments in them. But if both would produce the same output in 3.2 without HTML comments in them, then it means all newlines (which would convert to <br/> for output) must be eliminated to not invalidate any HTML - and in that case I'm unable to use newlines in the output anymore.
  3. If using HTML comments has no effect then why is removing them considered a help/solution?
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7651
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: 3.2 BBCode for tables?

Post by JimA » Thu Apr 06, 2017 11:16 am

Everyone, please keep in mind this is a support topic and not a discussion topic.

JoshyPHP provided a potential solution, let's first wait and see if it works for the OP. If it doesn't, we can take another look at other potential solutions and go from there. ;)

If you disagree or have any issues with another user, as always feel free to send me a private message.
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

Mneme
Registered User
Posts: 13
Joined: Tue Aug 28, 2012 9:13 pm

Re: 3.2 BBCode for tables?

Post by Mneme » Thu Apr 06, 2017 1:43 pm

When I initially set these up on 3.1, I read that the comments were necessary for some reason I do not specifically recall.

Upon further investigation I did notice that the BBCodes rendered partially in the Preview screens, and also when I added newlines after the [table]. I experimented as suggested by removing the comment lines. It seems to now work:

https://www.tarazedi.com/viewtopic.php?f=2&t=184

The 3.1 version is here: http://f.tarazedi.com/viewtopic.php?f=39&t=180 Alas I do not have the skill or patience these days to convert my old pretty theme to the new type. :/

Code: Select all

[table]{TEXT}[/table]
<table style="margin-left:1em;display:inline-table;border:#333333 solid 1px;background:#000000">{TEXT}</table>

[tr]{TEXT}[/tr]
<tr>{TEXT}</tr>

[td]{TEXT}[/td]
<td valign=top style="border-top:1px solid #111111; border:1px solid #111111; padding:3px; margin:3px; border-radius:2px;font-size:0.8em">{TEXT}</td>

[tdc={NUMBER}]{TEXT}[/tdc]
<td valign=top colspan={NUMBER} style="padding:3px; margin:3px; border:1px solid #111111; border-radius:2px;font-size:0.8em">{TEXT}</td>
I even added a TH version. :) Thank you for your responses, folks!

Noviets
Registered User
Posts: 24
Joined: Thu Nov 12, 2015 7:04 pm
Location: Australia

Re: 3.2 BBCode for tables?

Post by Noviets » Sat Apr 08, 2017 5:13 am

I am using the exact code you posted but it just displayed the tags in the post. (except table).
Using [row] for <tr> and [cell] for <td>. Everything else is the same.
Am I missing a config setting somewhere?

User avatar
JoshyPHP
Code Contributor
Posts: 1025
Joined: Mon Jul 11, 2011 12:28 am

Re: 3.2 BBCode for tables?

Post by JoshyPHP » Sat Apr 08, 2017 5:23 am

Are you sure you're using the same definitions I posted above? viewtopic.php?p=14707186#p14707186

Try the same definitions with the same names and test them on your board using those names, e.g. [table][tr][td]...[/table] then make sure your own row/cell BBCodes use the same template and try it with your BBCode names.
I wrote the thing that does BBCodes in 3.2.

Noviets
Registered User
Posts: 24
Joined: Thu Nov 12, 2015 7:04 pm
Location: Australia

Re: 3.2 BBCode for tables?

Post by Noviets » Sat Apr 08, 2017 5:58 am

I double checked the bbcodes and all are correct.

As per your test.
Interestingly; It works using [td] and [tr] even though the bbcodes are identical when using [row] and [cell]

Post Reply

Return to “[3.2.x] Support Forum”