Simplified Table BBCode broken after 3.2 update, looking for replacement

Get help developing custom BBCodes or request one.
Post Reply
kbowen0188
Registered User
Posts: 6
Joined: Thu Dec 13, 2012 12:20 pm

Simplified Table BBCode broken after 3.2 update, looking for replacement

Post by kbowen0188 » Sun Sep 03, 2017 7:57 pm

The previous table code used was the one that can be found below. This was used because it was simple and easy to understand, and allowed the poster to customize the colors of the individual table, as a wide variety of color styles are used across the forum for various reasons.

BBCode Usage:

Code: Select all

[table2={COLOR1},{COLOR2},{SIMPLETEXT}]{TEXT}[/table2]
HTML Replacement

Code: Select all

<script language="Javascript">
var texto = "{TEXT}"';
texto = texto.replace("\r\n","");
texto = texto.replace("<br>","");
texto = texto.replace(" ","");
var linha = new Array();
linha = texto.split('L=');
var table = '<tbody style="align:none;"><TABLE width=auto cellpadding=1px cellspacing=1px border=0px>';
for (var i=1; i<linha.length; i++)
{
  table = table + '<TR>';
  var coluna = new Array();
  coluna = linha[i].split('|');
  for (var j=0; j<coluna.length; j++)
  {
         table = table + '<TD style="background: {COLOR1};  border: 0px {COLOR2} solid; padding:1px; vertical-align: middle; font-family: {SIMPLETEXT};">' + coluna[j].replace("amp;","") + '</TD>';      
  }
  table = table + '<TR>';
}
table = table + '</TABLE></tbody>';
document.write(table);
</script>
It appears this is due to JavaScript not liking line breaks, and the above script also being unsafe, as detailed here. There is also a possible solution posted in the same thread, and while I have some skill in HTML and CSS, I am having a hard time getting this to work. This is an important feature to the owner of the forum and I am willing to pay if this would need custom development. Would anyone happen to have a solution that allows me to keep the previous BBCode Usage while fixing the HTML Replacement?

kbowen0188
Registered User
Posts: 6
Joined: Thu Dec 13, 2012 12:20 pm

Re: Simplified Table BBCode broken after 3.2 update, looking for replacement

Post by kbowen0188 » Thu Sep 28, 2017 2:31 pm

Bump.

Post Reply

Return to “Custom BBCode Development and Requests”

Who is online

Users browsing this forum: No registered users and 8 guests