UrbanTwitch Posted November 22, 2008 Share Posted November 22, 2008 http://cookyx.com/forum.php?at=forums&action=forumdisplay&id=15¤tpage=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 More sharing options...
UrbanTwitch Posted November 22, 2008 Author Share Posted November 22, 2008 Why can't I edit this topic? Anyways here it is: The link I posted will not work unless you switch forumdisplay into topic Link to comment https://forums.phpfreaks.com/topic/133759-php-bbcode-quotes-overlapp/#findComment-696099 Share on other sites More sharing options...
redarrow Posted November 22, 2008 Share Posted November 22, 2008 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 https://forums.phpfreaks.com/topic/133759-php-bbcode-quotes-overlapp/#findComment-696128 Share on other sites More sharing options...
redarrow Posted November 22, 2008 Share Posted November 22, 2008 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 https://forums.phpfreaks.com/topic/133759-php-bbcode-quotes-overlapp/#findComment-696131 Share on other sites More sharing options...
DarkerAngel Posted November 22, 2008 Share Posted November 22, 2008 I think what he's trying to do is fix the problem with the quote nested within a quote. Link to comment https://forums.phpfreaks.com/topic/133759-php-bbcode-quotes-overlapp/#findComment-696135 Share on other sites More sharing options...
thebadbad Posted November 22, 2008 Share Posted November 22, 2008 You can handle the opening and closing tags individually; see this post. Link to comment https://forums.phpfreaks.com/topic/133759-php-bbcode-quotes-overlapp/#findComment-696140 Share on other sites More sharing options...
laffin Posted November 22, 2008 Share Posted November 22, 2008 which means a stack based bbcode parser, or a preprocessor that accts for bbcode tags and identifiers. Actually i already made a stack based bbcode parser, but it has its limits as well. let me see wut i can do with unique identifiers. Link to comment https://forums.phpfreaks.com/topic/133759-php-bbcode-quotes-overlapp/#findComment-696141 Share on other sites More sharing options...
UrbanTwitch Posted November 22, 2008 Author Share Posted November 22, 2008 Yes, DarkerAnge, that is what I want. 100% working nested quote tags. Thank you thebadbad, I will try that. Link to comment https://forums.phpfreaks.com/topic/133759-php-bbcode-quotes-overlapp/#findComment-696377 Share on other sites More sharing options...
UrbanTwitch Posted November 22, 2008 Author Share Posted November 22, 2008 Thank you so much!! Link to comment https://forums.phpfreaks.com/topic/133759-php-bbcode-quotes-overlapp/#findComment-696588 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.