2015-05-05, 03:15 PM
I've developed a 'thread-displayer' that I'm currently using on my frontpage. It's working fine.
But my question is - How can I make the BBCodes work? It works fine on the forum, but I guess I need some kind of coding in order to make the BBCodes appear on the frontpage as they do in the actual thread.
I've tried the following:
I copied it to test it, but I received an error;
But my question is - How can I make the BBCodes work? It works fine on the forum, but I guess I need some kind of coding in order to make the BBCodes appear on the frontpage as they do in the actual thread.
I've tried the following:
<?php
$arrayBBCode=array(
''=> array('type'=>BBCODE_TYPE_ROOT, 'childs'=>'!i'),
'i'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<i>',
'close_tag'=>'</i>', 'childs'=>'b'),
'url'=> array('type'=>BBCODE_TYPE_OPTARG,
'open_tag'=>'<a href="{PARAM}">', 'close_tag'=>'</a>',
'default_arg'=>'{CONTENT}',
'childs'=>'b,i'),
'img'=> array('type'=>BBCODE_TYPE_NOARG,
'open_tag'=>'<img src="', 'close_tag'=>'" />',
'childs'=>''),
'b'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<b>',
'close_tag'=>'</b>'),
);
$text=<<<EOF
[b]Bold Text[/b]
[i]Italic Text[/i]
[url]http://www.php.net/[/url]
[url=http://pecl.php.net/][b]Content Text[/b][/url]
[img]http://static.php.net/www.php.net/images/php.gif[/img]
[url=http://www.php.net/]
[img]http://static.php.net/www.php.net/images/php.gif[/img]
[/url]
EOF;
$BBHandler=bbcode_create($arrayBBCode);
echo bbcode_parse($BBHandler,$text);
?>
I copied it to test it, but I received an error;
Fatal error: Call to undefined function bbcode_create() in /usr/www/optimuslogin/public/index.php on line 193