Seite 1 von 2
[3.2.0] bbcode "table" funktioniert nicht mehr
Verfasst: 31.01.2017 15:27
von maik63de
Hallo,
ich habe mir unter der Forensoftware 3.0.14 die bbcodes "table" "tr" und "td" erstellt um Tabellen anzulegen, hat auch alles super geklappt.
Nun nach dem Update auf 3.2.0 sind die Tabellen auch noch OK, aber wenn ich nun einen Beitrag mit Tabelle editiere, bzw. einen neuen erstelle, werden die bbcodes für die Tabelle nicht mehr als solche erkannt, sondern nur als "Text" ausgegeben.
Weiß jemand zufällig woran das liegen könnte?
Re: [3.2.0] bbcode "table" funktioniert nicht mehr
Verfasst: 01.02.2017 22:49
von Twister57
Bei mir wird die Tabelle gar nicht mehr angezeigt. Bei 3.1.10 ging es noch problemlos.
Wäre klasse, wenn da jemand helfen könnte.
Re: [3.2.0] bbcode "table" funktioniert nicht mehr
Verfasst: 01.02.2017 22:53
von Melmac
Hi,
wie sehen die verwendeten BBCodes und deren HTML-Ersetzungen aus?
Re: [3.2.0] bbcode "table" funktioniert nicht mehr
Verfasst: 02.02.2017 07:18
von Thunder_one
Der BBcode sieht so aus
So die HTML-Ersetzung
Code: Alles auswählen
<script type="text/javascript">
//<![CDATA[
function tableposting(text) {
if (typeof(text) == "string") {
text = text.replace(/<table(.*?)>/ig, "<table class='posttable'>");
text = text.replace(/<th(.*?)>/ig, "<th>");
text = text.replace(/<tr(.*?)>/ig, "<tr>");
text = text.replace(/<td(.*?)>/ig, "<td>");
text = text.replace(/<thead(.*?)>/ig, "<thead>");
text = text.replace(/<tfoot(.*?)>/ig, "<tfoot>");
text = text.replace(/<\/th>/ig, "</th>");
text = text.replace(/<\/tr>/ig, "</tr>");
text = text.replace(/<\/td>/ig, "</td>");
text = text.replace(/<\/thead>/ig, "</thead>");
text = text.replace(/<\/tfoot>/ig, "</tfoot>");
text = text.replace(/<\/table>/ig, "</table>");
text = text.replace(/<br \/>/ig, "");
}
return text;
}
document.write(tableposting('{TEXT}'));
css = '.posttable {border-collapse:collapse;width:96%;margin:2%;} .posttable th{padding:4px;border:1px solid black;background:lightblue;} .posttable tr:nth-child(odd){background-color:beige;} .posttable tr:nth-child(even){background-color:lightgrey;} .posttable td{padding:4px;vertical-align:middle;border:1px solid black;}',
head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
//]]>
</script>
Und so wie die HTML-Ersetzung ist, funktioniert das ganze unter 3.2 nicht mehr. Unter 3.1 lief alles noch problemlos.
Re: [3.2.0] bbcode "table" funktioniert nicht mehr
Verfasst: 02.02.2017 09:56
von maik63de
Bei mir so:
HTML-Ersetzung:
Code: Alles auswählen
<table border="{NUMBER}" style="margin-left:10px; border-collapse:collapse">{TEXT}</table>
HTML-Ersetzung:
HTML-Ersetzung:
Re: [3.2.0] bbcode "table" funktioniert nicht mehr
Verfasst: 04.02.2017 12:54
von maik63de
Hi, konnte das Problem so lösen:
php-code für "
table":
HTML-Ersetzung:
Code: Alles auswählen
<table border="{NUMBER}" cellspacing="1" width="100%">{TEXT}</table>
php-code für "
tr":
HTML-Ersetzung:
php-code für "
td":
HTML-Ersetzung:
php-code für "
th":
HTML-Ersetzung:
Re: [3.2.0] bbcode "table" funktioniert nicht mehr
Verfasst: 12.05.2017 22:04
von LuMaReMa
Hi! Ich habe das Problem mit den Tabellen auch. Alles was vorher in 3.1 geklappt ist jetzt im EImer. Jetzt habe ich alle Codes rausgeschmissen und neue gem. deines Vorschlages erstellt. Ich bekomme die Tabelle aber nicht hin. Kannst du bitte mal von deiner Tabelle den Code hier posten? Danke im voraus!
Re: [3.2.0] bbcode "table" funktioniert nicht mehr
Verfasst: 13.05.2017 10:22
von maik63de
Code: Alles auswählen
[table=1]
[tr=1]
[th=1]Feld 1[/th]
[th=1]Feld 2[/th]
[th=1]Feld 3[/th]
[th=1]Feld 4[/th]
[th=1]Feld 5[/th]
[th=1]Feld 6[/th]
[/tr]
[tr=1]
[td=1]Eintrag 1[/td]
[td=1]Eintrag 2[/td]
[td=1]Eintrag 3[/td]
[td=1]Eintrag 4[/td]
[td=1]Eintrag 5[/td]
[td=1]Eintrag 6[/td]
[/tr]
[tr=1]
[td=1]Eintrag 7[/td]
[td=1]Eintrag 8[/td]
[td=1]Eintrag 9[/td]
[td=1]Eintrag 10[/td]
[td=1]Eintrag 11[/td]
[td=1]Eintrag 12[/td]
[/tr]
[/table]
So werden die Tabellen erstellt.
Re: [3.2.0] bbcode "table" funktioniert nicht mehr
Verfasst: 13.05.2017 15:59
von LuMaReMa
Danke dir. Es klappt aber nicht. Bei mir kommt das dabei raus:
[ externes Bild ]
Re: [3.2.0] bbcode "table" funktioniert nicht mehr
Verfasst: 13.05.2017 17:01
von maik63de
LuMaReMa hat geschrieben:Danke dir. Es klappt aber nicht. Bei mir kommt das dabei raus:
[ externes Bild ]
edit: habe gerade festgestellt, dass ich noch einen "alten" BBCode drin hatte.
Füge mal den BBCode "tr" nochmal dazu:
Code: Alles auswählen
Beim Verfassen eines Beitrags anzeigen - ist nicht nötig
nun sollte es klappen