integrate_bbc_codes
Добавляем ббкод в ядро парсера ББ-кодов:
// SMF 2.0.2 Subs.php call_integration_hook('integrate_bbc_codes', array(&$codes));
function spoiler_bbc_codes(&$codes)
{
global $txt;
$ary = array(
array(
'tag' => 'spoiler',
'block_level' => true,
'before' => '<div class="sp-wrap"><div class="sp-body" title="' . $txt['spoiler_title'] . '">',
'after' => '</div></div>',
),
array(
'tag' => 'spoiler',
'type' => 'unparsed_equals', // парсить заголовок запрещено
'validate' => create_function('&$tag, &$data, $disabled', '
global $txt;
if (empty($data))
$data = $txt[\'spoiler_title\'];
// $data = str_replace(array("[", "]"), array("[", "]", $data));
'),
// 'test' => '[#]?([A-Za-z][A-Za-z0-9_\-]*)\]',
'block_level' => true,
'before' => '<div class="sp-wrap"><div class="sp-body" title="$1">',
'after' => '</div></div>',
));
$codes = array_merge($codes, $ary);
}