1

嗨,在过去的 3 年里,我的网站一直使用 SMF2,是时候离开它了例如,它无法解析引号的差异

[quote="MitchaP":1ru0x694][/quote:1ru0x694] 是 phpBB3 的样子,但 smf 看起来像 [quote="MitchaP"][/quote]

我试图修改 bbcode.php 文件,但没有运气,这是我到目前为止所拥有的,顺便说一句,即使这样,我的正则表达式也是起始级别:)

    $this->bbcode_cache[$bbcode_id] = array(
                    'str' => array(
                        '[/quote:$uid]' => $this->bbcode_tpl('quote_close', $bbcode_id),
          '[/quote]' => $this->bbcode_tpl('quote_close', $bbcode_id)
                    ),
                    'preg' => array(
                        '#\[quote(?:="(.*?)")?:$uid\]((?!\[quote(?:=".*?")?:$uid\]).)?#ise' => "\$this->bbcode_second_pass_quote('\$1', '\$2')",
          '#\[quote(?:=\"(.*?)\")?\](.+)\[/quote\]#ise' => "\$this->bbcode_second_pass_quote('\$1', '\$2')"
                    )
                );
4

1 回答 1

2

在includes/bbcode.php中找到

foreach ($bbcode_ids as $bbcode_id)
{
    switch ($bbcode_id)
    {

并将 case 0: 替换为以下

        case 0:
            if($this->bbcode_uid > 0)
            {
                $this->bbcode_cache[$bbcode_id] = array(
                    'str' => array(
                        '[/quote:$uid]' => $this->bbcode_tpl('quote_close', $bbcode_id)
                    ),
                    'preg' => array(
                        '#\[quote(?:="(.*?)")?:$uid\]((?!\[quote(?:=".*?")?:$uid\]).)?#ise' => "\$this->bbcode_second_pass_quote('\$1', '\$2')"
                    )
                );
            }
            else
            {
                $this->bbcode_cache[$bbcode_id] = array(
                    'str' => array(
                        '[/quote]'  => $this->bbcode_tpl('quote_close', $bbcode_id)
                    ),
                    'preg' => array(
                        '#\[quote(?:="(.*?)")?\]((?!\[quote(?:=".*?")?\]).)?#ise'   => "\$this->bbcode_second_pass_quote('\$1', '\$2')"
                    )
                );                  
            }
        break;

于 2013-05-20T14:53:14.520 回答