aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-09-26 21:43:55 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-09-26 21:43:55 +0000
commit33d7444cc45923f7358426d2a6e086031447041c (patch)
treea0f100985f393e93745914246f43ca5d93aed0d2 /phpBB/includes
parent58e830807ac3e2cc5cf3d75826b5a2db8bff49b5 (diff)
downloadforums-33d7444cc45923f7358426d2a6e086031447041c.tar
forums-33d7444cc45923f7358426d2a6e086031447041c.tar.gz
forums-33d7444cc45923f7358426d2a6e086031447041c.tar.bz2
forums-33d7444cc45923f7358426d2a6e086031447041c.tar.xz
forums-33d7444cc45923f7358426d2a6e086031447041c.zip
color and size tags
git-svn-id: file:///svn/phpbb/trunk@1092 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/bbcode.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 5b26b0790a..a95c5ce0c9 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -58,7 +58,15 @@ function bbencode_second_pass($text, $uid)
$text = str_replace("[/list:u:$uid]", '</ul>', $text);
$text = str_replace("[/list:o:$uid]", '</ol>', $text);
// Ordered lists
- $text = preg_replace("/\[list=([a1]):$uid\]/si", '<ol type="\1">', $text);
+ $text = preg_replace("/\[list=([a1]):$uid\]/si", '<ol type="\1">', $text);
+
+ // colours
+ $text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+):$uid\]/si", '<font color="\1">', $text);
+ $text = str_replace("[/color:$uid]", "</font>", $text);
+
+ // size
+ $text = preg_replace("/\[size=([\-\+]?[1-3]):$uid\]/si", '<font size="\1">', $text);
+ $text = str_replace("[/size:$uid]", "</font>", $text);
// [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.
$text = str_replace("[quote:$uid]", '<table border="0" align="center" width="85%"><tr><td><font size="-1">' . $lang['Quote'] . '</font><hr /> </td></tr><tr><td><font size="-1"><blockquote>', $text);
@@ -147,6 +155,12 @@ function bbencode_first_pass($text, $uid)
// ordered.
$text = bbencode_first_pass_pda($text, $uid, $open_tag, "[/list]", "[/list:o]", false, 'replace_listitems');
+ // [color] and [/color] for setting text color
+ $text = preg_replace("#\[color=(\#[0-9A-F]{6}|[a-z]+)\](.*?)\[/color\]#si", "[color=\\1:$uid]\\2[/color:$uid]", $text);
+
+ // [size] and [/size] for setting text size
+ $text = preg_replace("#\[size=([\-\+]?[1-3])\](.*?)\[/size\]#si", "[size=\\1:$uid]\\2[/size:$uid]", $text);
+
// [b] and [/b] for bolding text.
$text = preg_replace("#\[b\](.*?)\[/b\]#si", "[b:$uid]\\1[/b:$uid]", $text);