Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Quote BBCode

adrian.adrian.
edited June 2006 in Vanilla 1.0 Help
I'm currently moving my punbb forum across to Vanilla and I am using the Better BBCode extension to parse BBCode. The problem I'm having is that it's missing out the person you're quoting on the following example of a quote: [quote=author]Notable Post[/quote] Does anybody know of a way to change this extension to parse the example code correctly?

Comments

  • Options
    Yeah, this is one of the areas where I differ with the "standard" BBCode syntax; it is possible to do what you want with a custom preparse, but I'm not good enough with regular expressions to do it properly.
  • Options
    Same problem as @adrian and still no solution in sight.

    @Bergamot, how would you transform [quote=author] so that it would match your BBCode? If it's simple, then I can do that as part of the importing of the data.
  • Options
    MarkMark Vanilla Staff
    regex can be a nightmare. I've found that the app regexbuddy can be a lifesaver. I'm sure we must have some regex guru here in the community that could help. Anyone?
  • Options
    LincLinc Detroit Admin
    edited October 2009
    I'm not familiar with this BBCode extension, but here's how to parse bbcode quotes into HTML (I'm pretty sure, anyway). You can turn it into anything you want in the second argument; just use \\1 where you want the author and \\2 where you want the content.
    $content = preg_replace("/\[quote=(.*)\]([^\[]*)\[\/quote\]/Ui", '<blockquote><cite>\\1</cite>\\2</blockquote>', $content);
  • Options
    LincLinc Detroit Admin
    edited October 2009
    //edit: Nevermind, it was a simple fix. The above code should work fine now.
  • Options
    100
Sign In or Register to comment.