MyBB Community Forums

Full Version: Can't get postParser to parse newlines?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm currently writing a plgin that takes user input via a text area. I'm passing the input throgh the parser with the below code:

    require_once MYBB_ROOT.'inc/class_parser.php';
    $parser = new postParser;

$options = array(
    "allow_html" => 0,
    "allow_mycode" => 1,
    "allow_smilies" => 1,
    "allow_imgcode" => 0,
    "filter_badwords" => 1,
    "nl2br" => 1,
    "allow_videocode" => 0,
    "me_username" => $mybb->user['username'],

    $viddesc = $parser->parse_message($viddesc, $options);

Everything was working fine last night, but when I opened my test site up today, newlines don't appear to be getting parsed for some reason. I'm not sure if it's an issue with my code or my localhost, but I'd like somebody to just double check that what I'm doing is right.
The Parser class was altered in 1.6.2. Does running your code work on 1.6.1's Parser (or you're still using it)?
I've only got a 1.6.2 install here, but I'll try it out in a 1.6.1 install and see if it works as intended there.

Okay, I just tried it on my 1.6.1 install and it doesn't seem to work there either. Odd. It was certainly working last night.
Well you must certainly did something. Do you have a live preview that we can look at?
I don't have one at the minute, but I'll set ome up and PM you details.
Just tested this on my linux host and it's still not working. I'm going to just PM you a sample file Pirata if that's okay?