Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Quotes 1.6.9, vanil'a 2.1.6 and BBCode

K17K17 Français / French Paris, France ✭✭✭
edited December 2014 in Vanilla 2.0 - 2.8

Hi !
I've a problem with Quote 1.6.9, vanilla 2.1.6 and the BBCode.

Have you the solution?

NB: I've not edited the quote plugin, and it's the same with default theme.

Comments

  • Options
    BleistivtBleistivt Moderator
    edited December 2014

    Yes, nested Quotes don't work with BBCode. I have written a small plugin to work around that in the past:

    Edit, ok, looks like the Syntax prettifier messes things up, I attached it.

  • Options
    x00x00 MVP
    edited December 2014
    <?php if (!defined('APPLICATION')) exit();
    
    $PluginInfo['BBQuoteFix'] = array(
        'Name' => 'BBQuoteFix',
        'Version' => '1',
        'Author' => 'Bleistivt',
        'MobileFriendly' => true,
    );
    class BBQuoteFixPlugin extends Gdn_Plugin {
    
        private function Quotes($Mixed2) {
            for ($i = 0; stripos($Mixed2, '[quo'.'te=') !== false && $i < 10; $i++) {
                $Mixed2 = preg_replace(
                    "#\[quo'.'te=[\"']?([^\]]+)(;[\d]+)?[\"']?\](.*?)\[/qu'.'ote\]#si",
                    '<blockquote class="Quote" rel="\\1"><div class="QuoteAuthor">'.sprintf(T('%s said:'), '\\1').'</div><div class="QuoteText">\\3</div></blockquote>',
                    $Mixed2
                );
            }
            return $Mixed2;
        }
    
        public function PostController_BeforeCommentPreviewFormat_Handler($Sender) {
            $Sender->Comment->Body = $this->Quotes($Sender->Comment->Body);
        }
    
        public function DiscussionController_BeforeCommentBody_Handler($Sender) {
            $Sender->EventArguments['Object']->Body = $this->Quotes($Sender->EventArguments['Object']->Body);
        }
    
    }
    

    grep is your friend.

  • Options
    x00x00 MVP
    edited December 2014

    I see the problem with the syntax highlighter. The Quotes plugin is applying bbcode quotes filter even though the format is markdown and this over the code block.

    grep is your friend.

  • Options
    K17K17 Français / French Paris, France ✭✭✭

    Thx, but, it's the same. They have ni changes (I'v tested with a new discussion too).

  • Options

    Then you may have a different problem, could you post the raw bbcode created by the quotes plugin on your site?

  • Options
    K17K17 Français / French Paris, France ✭✭✭
    edited December 2014

    @Bleistivt said:
    Then you may have a different problem, could you post the raw bbcode created by the quotes plugin on your site?

    [quote="Kube17;25"][quote="Kube17;8"]First level[/quote] Second level [/quote]

    Thx For help :)

  • Options

    That is the HTML, I meant the BBCode.

    Also, it looks correct:

    said:

    said:

    First level

    Second level
  • Options
    K17K17 Français / French Paris, France ✭✭✭

    @Bleistivt said:
    That is the HTML, I meant the BBCode.

    Also, it looks correct:

    said:

    said:

    First level

    Second level

    I've send the bbcode and vforg have édités it...

  • Options
    K17K17 Français / French Paris, France ✭✭✭
  • Options

    Bleistivt, you're my hero. That plugin fixed the nest comments issue my forums are having as well (I use BBCode & ButtonBar)

  • Options
    K17K17 Français / French Paris, France ✭✭✭

    Problem solved when adding NBBC.

Sign In or Register to comment.