MyBB Community Forums

Full Version: Parser not parsing?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have this piece of code:

require_once  MYBB_ROOT.'inc/class_parser.php';

	$parser = new postParser;

	$options = array(
		"allow_html"		=>	0,
		"filter_badwords"	=>	1,
		"allow_mycode"		=>	1,
		"allow_smileys"		=>	1,
		"nl2br"				=>	1,
		"me_username"		=>	0);

	$parser->parse_message($content, $options);

This is what happens:

I set $content to [i]testing[/i].
$content is displayed as [i]testing[/i] (unparsed).

It's not a function, it's a piece of code inside a file in my MyBB root. How can I remedy this?

If it matters, I am developing on localhost, and I have sometimes noticed that paths using $mybb->settings['bburl'] don't always work, and I have to use the system path ("C:\wamp" etc). I tried that with this and it's not working.
Use the return value.

	$my_parsed_message = $parser->parse_message($content, $options);

Use $my_parsed_message.
(2013-04-01, 02:05 AM)April Fool Wrote: [ -> ]Use the return value.

	$my_parsed_message = $parser->parse_message($content, $options);

Use $my_parsed_message.

Thank you, April Fool. Smile
You're welcome Smile