Ok, I think I get as much so far on this topic, but for some reason none of my added codes are being parsed. I'm using the bbcode_create hook for a bbcode plugin, here's my xml:
PHP Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<plugins>
<plugin active="1" product="dice_roll">
<title>parse vBCode roll</title>
<hookname>bbcode_create</hookname>
<phpcode><![CDATA[$this->tag_list['no_option']['roll'] = array(
'callback' => 'handle_external',
'strip_empty' => true,
#'stop_parse' => false,
#'disable_smilies' => true,
#'disable_wordwrap' => true,
#'strip_space_after' => 1
'external_callback' => 'handle_rolltag'
);
$this->tag_list['option']['roll'] = array(
'callback' => 'handle_external',
'strip_empty' => true,
#'stop_parse' => false,
#'disable_smilies' => true,
#'disable_wordwrap' => true,
#'strip_space_after' => 1
'external_callback' => 'handle_rolltag'
);
if (!function_exists('handle_rolltag')) {
require_once(DIR.'/includes/class_dice.php');
function handle_rolltag(&$parser, $code, $option='') {
$dice = new Dice;
$code = preg_replace('!\[roll\](.*)\[/roll\]!e',
'\'<i>(\\1)</i> <b>\'.\$dice->roll(\'\\1\').\'</b>\'',
$code
);
return $code;
}
}
#if($this->is_wysiwyg()) {
#$this->unparsed_tags[] = 'roll';
#}]]></phpcode>
</plugin>
</plugins>
What exactly am I missing here? I've also added the bbcode to the bbcode table, so you see a [roll][/roll] showing up in custom bbcode manager. I'm a bit confused.