From 6b07955476a9932b247df678ec19a6b0ddaf440d Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Mon, 28 Dec 2009 17:12:53 +0000 Subject: (OC) phased out BBCode() and added the extras to bbcode_format() condensed the style sheets. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@406 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- includes/functions.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'includes/functions.php') diff --git a/includes/functions.php b/includes/functions.php index 4db70c5..05d6457 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -35,45 +35,51 @@ function bbcode_format ($str) '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', + '/\[s\](.+?)\[\/s\]/is', '/\[hr\]/is', '/\[pi\](.*?)\[\/pi\]/is', - '/\[center\](.*?)\[\/center\]/is', '/\[title\](.*?)\[\/title\]/is', '/\[article\](.*?)\[\/article\]/is', '/\[section\](.*?)\[\/section\]/is', '/\[code\](.*?)\[\/code\]/is', '/\[quote\](.*?)\[\/quote\]/is', '/\[quote\=(.*?)\](.*?)\[\/quote\]/is', + '/\[url\](.*?)\[\/url\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[align\=(.*?)\](.*?)\[\/align\]/is', '/\[size\=(.*?)\](.*?)\[\/size\]/is', - '/\[img\=(.*?)\](.*?)\[\/img\]/is' + '/\[img\=(.*?)\](.*?)\[\/img\]/is', + '/\[img align\=(.+?)\](.+?)\[\/img\]/is', + '/\[mail\](.*?)\[\/mail\]/is', + '/\[mail\=(.*?)\](.*?)\[\/mail\]/is' ); $simple_replace = array( '$1', '$1', '$1', + '$1', '
', '

$1

', - '
$1
', '

$1

', '

$1

', '

$1

', '
$1
', '
$1
', '$1 wrote:
$2
', + '$1', '$2', - '$2', + '
$2', '$2', - '$2' + '$2', + '', + '$1', + '$2' ); - $order = array("\r\n", "\n", "\r"); - $replace = "\n
"; $str = preg_replace ($simple_search, $simple_replace, $str); - $str = str_ireplace($order,$replace,$str); + $str = nl2br($str); return $str; } -- cgit