2022-07-13, 10:58 PM
Hi there!
I have a question related to plugins and extensions with textareas in general: I want to parse the line break in PHP sothat when people write, for example:
in the Editor, it does not end as
I understand that
Is the way to go and I have the following code which I put on top of my extra PHP page, just below "require_once"
However, although HTML works, converting the line break in the input to an actual linebreak on the output does not work.
Can anyone tell me how to use this properly? I'm fairly new to PHP.
Thanks!
I have a question related to plugins and extensions with textareas in general: I want to parse the line break in PHP sothat when people write, for example:
Quote:Hello World!
How are you?
in the Editor, it does not end as
Quote:Hello World!How are you?
I understand that
"nl2br" => 1,
Is the way to go and I have the following code which I put on top of my extra PHP page, just below "require_once"
global $mybb, $templates, $lang, $header, $headerinclude, $footer, $page, $db, $noticeboard_navigation, $noticeboard_bit, $options;
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
$options = array(
"allow_html" => 1,
"allow_mycode" => 1,
"allow_smilies" => 1,
"allow_imgcode" => 1,
"filter_badwords" => 0,
"nl2br" => 1,
"allow_videocode" => 0
);
However, although HTML works, converting the line break in the input to an actual linebreak on the output does not work.
Can anyone tell me how to use this properly? I'm fairly new to PHP.
Thanks!