Jump to content

PHP BBCode Quotes Overlapp


UrbanTwitch

Recommended Posts

http://cookyx.com/forum.php?at=forums&action=forumdisplay&id=15&currentpage=2#post_165

 

If you go to the last post: You will see the fault. The

does not match the top one.

 

The code:

 

[*quote=Dan][*quote=Dan]Reppiggggggg[/quote]
oh yeah!?!?[/quote]
hahahahaa

 

See? How do I fix this problem?

 

Here is the BBcode if you need.

 

'#\[quote=(.*?)\](.*?)\[\/quote\]#se'

 

turns into:

 

"'<div style=\"padding:5px;color:#929292;background:#ECECEC url(http://i38.tinypic.com/2navi3s.png) no-repeat right;border-left:4px solid #BDBDBD;border-top:1px solid #BDBDBD;border-right:1px solid #BDBDBD;\">QUOTE ( \\1 )</div>
<div  style=\"padding:5px;color:#929292;background:#FBFBFB;border-left:4px solid #BDBDBD;border-bottom:1px solid #BDBDBD;border-right:1px solid #BDBDBD;\">\\2</div>'"

 

Thanks so much, I tried many variations.

Link to comment
https://forums.phpfreaks.com/topic/133759-php-bbcode-quotes-overlapp/
Share on other sites

little example for yaaaaaaaaaaa!

 

<?php

$output="hi there i am [quote]redarrow[/quote]it working [quote]lol![/quote]";

$find = array( "'\[quote\](.*?)\[/quote\]'is"); 
$replace = array( "<table bgcolor='gray'><tr><td><font color='yellow'>\\1</font></tr><td></table>"); 

echo preg_replace($find,$replace,$output); 

?>

try this.......

<?php

$output="[quote]redarrow[/quote] [quote]lol![/quote] [quote]yeeeee haaaaaaaaaaa[/quote]";

$find = array( "'\[quote\](.*?)\[/quote\]'is"); 
$replace = array( "<div style=\"padding:5px;color:#929292;background:#ECECEC url(http://i38.tinypic.com/2navi3s.png) no-repeat right;border-left:4px solid #BDBDBD;border-top:1px solid #BDBDBD;border-right:1px solid #BDBDBD;\">QUOTE ( \\1 ) <br><br><div  style=\"padding:5px;color:#929292;background:#FBFBFB;border-left:4px solid #BDBDBD;border-bottom:1px solid #BDBDBD;border-right:1px solid #BDBDBD;\">\\2</div><br><br>"); 

echo preg_replace($find,$replace,$output); 

?>

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.