Added [center] bbcode support.

This commit is contained in:
Abinoam P. Marques Jr 2012-02-12 15:51:17 -08:00
parent 74b529bda2
commit 3a07973ffa

View file

@ -142,6 +142,9 @@ function bbcode($Text,$preserve_nl = false) {
$Text = preg_replace("(\[size=(\d*?)\](.*?)\[\/size\])ism","<span style=\"font-size: $1px;\">$2</span>",$Text);
$Text = preg_replace("(\[size=(.*?)\](.*?)\[\/size\])ism","<span style=\"font-size: $1;\">$2</span>",$Text);
// Check for centered text
$Text = preg_replace("(\[center\](.*?)\[\/center\])ism","<div style=\"text-align:center;\">$1</div>",$Text);
// Check for list text
if(stristr($Text,'[/(list|ul|ol)]'))