The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Replace <br> with <p> in Context
vbulletin uses <br> instead of <p> in Content text where/how can I replace that for proper formatting?
The <br> tag should only be used to break line i.e <p>This is first line <br> This is second line.</p> Converting non-block elements with <br /> to <p> in PHP I was thinking something along the lines of: Code:
function sanitize_content($data) { $data = strip_tags($data,'<p>,<br>,<img>,<a>,<strong>,<u>,<em>,<blockquote>,<ol>,<ul>,<li>,<span>'); $data = trim($data,'<p>'); $data = trim($data,'</p>'); $data = trim($data,'<br />'); $data = preg_replace('#(?:<br\s*/?>\s*?){2,}#','</p><p>',$data); $data = '<p>'.$data.'</p>'; return $data; } In the CMS Articles I'm using HTML On- Convert Linebreaks (which uses on_nl2br) - so maybe the variable couple be changed using str_replace?? Code:
$variable = '<p>' . str_replace("\n", "</p><p>", $variable) . '</p>'; This is from includes/class_bbcode_alt.php Code:
starts line 156 protected function rematchIELinebreaks($match) { $text = $match[3]; $open = $match[1]; $close = $match[2]; if (strpos($text, "\n") !== false) { $text = str_replace("</p>\n<p>", "<br>\n", $text); return '[' . $open . ']' . $text . '[/' . $close . ']'; } else { return $match[0]; } } Any ideas how to achieve this? |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|