Jump to content

Quote within a quote bbcode script?


Toshiba23

Recommended Posts

Ok, all forums have this... a quote within a quote... simple right? Just put this...

 

[quote]This is a quote
[quote]this another quote... inside the first one
[/quote]
[/quote]

 

This is a quote

this another quote... inside the first one

 

I can make my script do 1 quote... but another one inside of it is beyond me... some help?

Heres my script:

 

preg_match_all('#\[quote=(.*?)\](.*?)\[/quote\]#s', $text, $matches);
    
    foreach($matches as $key => $val){
        $author = $usr->user2link($matches[1][$key]);
        
        $quoted  = "<table width=\"95%\" align=center cellpadding=2 cellspacing=0 border=0 style=\"border: #000000 1px solid;\">\n";
        $quoted .= "<tr>\n";
        $quoted .= "<td class=\"row1\">Quoting $author</td>\n";
        $quoted .= "</tr><tr>\n";
        $quoted .= "<td class=\"row3\">".$matches[2][$key]."</td></tr></table>\n";

        $text = str_replace($matches[0][$key], $quoted, $text);
    }  

Link to comment
https://forums.phpfreaks.com/topic/40791-quote-within-a-quote-bbcode-script/
Share on other sites

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.