Jump to content

quote bbcode corrupting tables


fix3r

Recommended Posts

I have my quote bbcode that I use on my custom forums that I did, but for some reason, when ever I use it, it somehow seem's to corrupt my tables (posts) to look like crap. Could anyone point me in the right direction of what I am doing wrong?

[code]
function parse($i) {
$i = preg_replace("/\[quote=\"([a-zA-Z :\_\/\.\-]+)\"\]/","<br /><table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\" style=\"border: 1px solid #000000; background: #262626;\"><tr><td><span style=\"font-size: 12px;\">Originally Posted By <b>$1</b><br /><i>",$i);
$i = preg_replace("/\[\/quote\]/","</i></span></td></tr></table>",$i);

return $i;
}
[/code]
Link to comment
https://forums.phpfreaks.com/topic/36420-quote-bbcode-corrupting-tables/
Share on other sites

[quote author=effigy link=topic=124799.msg518037#msg518037 date=1170257335]
I'm not sure I follow, but it sounds like your regex is working fine. Have you tried giving the span a class and using CSS, instead of using the whole table contraption?
[/quote]

Okay, what happen's is, when I use the quote bbcode. For every post it has <table>...</table> What happens is it cuts off my table and then starts it back up again and pretty much corrupts my html.
[b]With Quotes:[/b]
[img]http://img267.imageshack.us/img267/6448/withquotesrl7.png[/img]

[b]Without Quotes: [/b]
[img]http://img201.imageshack.us/img201/6801/withoutquotesvi0.png[/img]


Ugh, now my whole bbcode is getting messed up. If anyone has any bbcode for colors, ect, that they would like to share that replaces the WHOLE code, not just if you type in [color="red"] it will replace it and then if you don't do the other thing right it won't replace that.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.