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
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); 

?>

Link to comment
Share on other sites

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); 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.