tags = array(
// The exact B BBcode from phpBB
'b' => array(
'replace' => '',
'close' => '',
'attributes' => array(),
'children' => array(true, 'quote' => true, 'code' => true, 'list' => true),
'parents' => array(true),
),
// The exact I BBcode from phpBB
'i' => array(
'replace' => '',
'close' => '',
'attributes' => array(),
'children' => array(true, 'quote' => true, 'code' => true, 'list' => true),
'parents' => array(true),
),
// The exact U BBcode from phpBB
'u' => array(
'replace' => '',
'close' => '',
'attributes' => array(),
'children' => array(true, 'quote' => true, 'code' => true, 'list' => true),
'parents' => array(true),
),
// Quote tag attempt.
'quote' => array(
'replace' => '
{_}
',
'close' => '
',
'attributes' => array(
'_' => array(
'replace' => '%s wrote:',
),
),
'children' => array(true),
'parents' => array(true),
),
// code tag (without the =php functionality)
'code' => array(
'replace' => 'Code:
',
'close' => '
',
'attributes' => array(),
'children' => array(false),
'parents' => array(true),
),
// list tag
'list' => array(
'replace' => '',
'replace_func' => array($this, 'list_open'),
'close' => '',
'close_func' => array($this, 'list_close'),
'attributes' => array(
'_' => array(
'replace' => '',
),
),
'children' => array(false, 'li' => true),
'parents' => array(true),
),
// The exact * tag from phpBB. "*" is not a valid tag name in this parser... introducing li from HTML!
'li' => array(
'replace' => '',
'close' => '',
'close_shadow' => true,
'attributes' => array(),
'children' => array(true, 'li' => true),
'parents' => array(false, 'list' => true),
),
// Almost exact img tag from phpBB...
'img' => array(
'replace' => '
',
'attributes' => array(
'__' => array(
'replace' => '%s',
),
),
'children' => array(false),
'parents' => array(true),
),
'url' => array(
'replace' => '',
'replace_func' => array($this, 'url_tag'),
'close' => '',
'attributes' => array(
// The replace value is not important empty because the replace_func handles this.
'_' => array(
'replace' => '',
),
'__' => array(
'replace' => '',
),
),
'children' => array(false),
'parents' => array(true),
),
'color' => array(
'replace' => '',
'close' => '',
'attributes' => array(
'_' => array(
'replace' => '%s',
'required' => true
),
),
'children' => array(true, 'color' => true),
'parents' => array(true),
),
'size' => array(
'replace' => '',
'close' => '',
'attributes' => array(
'_' => array(
'replace' => '%s',
'required' => true
),
),
'children' => array(true, 'size' => true),
'parents' => array(true),
),
// FLASH tag implementation attempt.
'flash' => array(
'replace' => '',
'close' => false,
'attributes' => array(
'm' => array(
'replace' => '%s',
'required' => true,
),
'w' => array(
'replace' => ' width="%s"',
'type_check' => 'ctype_digit',
),
'h' => array(
'replace' => ' height="%s"',
'type_check' => 'ctype_digit',
),
),
'children' => array(false),
'parents' => array(true),
),
// The spoiler tag from area51.phpbb.com :p
'spoiler' => array(
'replace' => 'Spoiler:',
'close' => '',
'attributes' => array(),
'children' => array(false),
'parents' => array(true),
),
// a noparse tag
'noparse' => array(
'replace' => '',
'close' => '',
'attributes' => array(),
'children' => array(false),
'parents' => array(true),
),
);
$this->smilies = array(
':)' => '
',
':(' => '
',
);
// $this->text_callback = 'strtoupper';
parent::__construct();
}
protected function url_tag(array $attributes = array(), array $definition = array())
{
if (isset($attributes['_']))
{
return '';
}
return '';
}
protected function list_open(array $attributes = array(), array $definition = array())
{
if (isset($attributes['_']))
{
return '';
}
return '';
}
protected function list_close(array $attributes = array())
{
if (isset($attributes['_']))
{
return '
';
}
return '';
}
}