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