我真的很喜欢这段代码https://www.vbulletin.org/forum/showthread.php?t=90869 我试图把它变成VBB4。
这是我到目前为止所拥有的。我试图解决它
bbcode_parse_start
foreach ($this->tag_list['option'] AS $tag => $bbcode)
{
if (strpos($bbcode['html'], '{option1}'))
{
$this->tag_list['option']["$tag"]['replace'] = preg_replace('/\{option(\d+)\}',
create_function ('$option',"'%' . (intval('\\1')+1) . '\$s'" , $bbcode['html'])
unset($this->tag_list['option']["$tag"]['html']);
$this->tag_list['option']["$tag"]['callback'] = 'handle_external';
$this->tag_list['option']["$tag"]['external_callback'] = 'handle_bbcode_multioption';
}
}
bbcode_fetch_tags
if (!function_exists('handle_bbcode_multioption'))
{
function handle_bbcode_multioption(&$parser, $param, $options)
{
$taginfo = $parser->tag_list['option'][$parser->current_tag['name']];
$replace = array($param);
$replace = array_merge($param, explode('|', $options));
return @vsprintf($taginfo['replace'], $replace);
}
}