diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2011-04-17 20:13:07 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2011-04-17 20:13:07 -0400 |
commit | 0077cb99704fe863cf731fc5cab792af2ede96c2 (patch) | |
tree | dd68f44971aa2aee821f588d33b250dcd2fe57e3 /include/functions.php | |
parent | e8b28c5e910d92cbec3d4baa6e98f025e8418d28 (diff) | |
download | bayonetcms-0077cb99704fe863cf731fc5cab792af2ede96c2.tar.gz |
Backporting retarded amount of changes outside of version control
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/functions.php b/include/functions.php index 109f11c..370ed9f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -51,11 +51,13 @@ function bbcode_format ($str) '/\[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', - '/\[list\](.*?)\[\/list\]/is' + '/\[list\](.*?)\[\/list\]/is', + '/\[list=1\](.*?)\[\/list\]/is', + '/\[\*\]/is' ); $simple_replace = array( @@ -75,13 +77,16 @@ function bbcode_format ($str) '<a href="$1">$2</a>', '<div style="text-align: $1">$2</align>', '<font style="font-size:$1px;">$2</font>', - '<img src="$1" alt="$2"/>', - '<img src=\"$2\" align=\"$1\" />', + '<img src="$1"/>', + '<img src="$2" align="$1" style="padding:5px;" />', '<a href="mailto:$1">$1</a>', '<a href="mailto:$1">$2</a>', - '<li style="list-style-position: inside; padding:10px">$1</li>' + '<ul class="listbullet">$1</ul>', + '<ol>$1</ol>', + '<li>' ); + $str = preg_replace ($simple_search, $simple_replace, $str); $str = nl2br($str); return $str; |