
<?php
public function getContent() {
$message = $this->get('message');
$tags = array(
//bbcodes tags list here - Don't play well with SMF parser
);
if ($this->xpdo->getOption('discuss.bbcode_enabled',null,true)) {
$message = str_replace($tags,array(
'<','>',
'<strong>','</strong>',
'<em>','</em>',
'<img src="','">',
'<div class="dis-code"><h5>Code</h5><pre>','</pre></div>',
'<div class="dis-quote"><h5>Quote</h5><div>','</div></div>',
'<span class="dis-strikethrough">','</span>',
'<a href="','</a>',
'<a href="mailto:','</a>',
'<hr />',
'<ul>','</ul>','<li>','</li>',
'">',
),$message);
} else {
$message = str_replace($tags,'',$message);
}
return $this->_nl2br2($message);
}
<?php
public function getContent() {
$message = $this->get('message');
//Should contain a processor with the custom BBCode parser
if($this->xpdo->getOption('discuss.custom_bbcode_parser',null, 'none') != 'none' ){
//$message is processed through this custom bbcode parser
} else {
$tags = array(
//bbcode tags list
);
if ($this->xpdo->getOption('discuss.bbcode_enabled',null,true)) {
$message = str_replace($tags,array(
'<','>',
'<strong>','</strong>',
'<em>','</em>',
'<img src="','">',
'<div class="dis-code"><h5>Code</h5><pre>','</pre></div>',
'<div class="dis-quote"><h5>Quote</h5><div>','</div></div>',
'<span class="dis-strikethrough">','</span>',
'<a href="','</a>',
'<a href="mailto:','</a>',
'<hr />',
'<ul>','</ul>','<li>','</li>',
'">',
),$message);
} else {
$message = str_replace($tags,'',$message);
}
return $this->_nl2br2($message);
}
//The custom bbcode parser should have is own nl2br function
return $message;
}
This discussion is closed to further replies. Keep calm and carry on.