From f5db142d93906d9fd33ddcd75dfa56ec90ce3b9e Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 17 Mar 2012 12:15:59 +0100 Subject: Quotes with author are now having an "open/close" link --- include/bbcode.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index 9fce895b8..9befbd0f7 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -198,6 +198,17 @@ function bbcode($Text,$preserve_nl = false) { while ((strpos($Text, "[/spoiler]") !== false) and (strpos($Text, "[spoiler]") !== false) and (++$endlessloop < 20)) $Text = preg_replace("/\[spoiler\](.*?)\[\/spoiler\]/ism","$SpoilerLayout", $Text); + // Check for [spoiler=Author] text + + $t_wrote = t('$1 wrote:'); + + // handle nested quotes + $endlessloop = 0; + while ((strpos($Text, "[/spoiler]")!== false) and (strpos($Text, "[spoiler=") !== false) and (++$endlessloop < 20)) + $Text = preg_replace("/\[spoiler=[\"\']*(.*?)[\"\']*\](.*?)\[\/spoiler\]/ism", + "
" . $t_wrote . "
$2
", + $Text); + // Declare the format for [quote] layout $QuoteLayout = '
$1
'; @@ -215,7 +226,7 @@ function bbcode($Text,$preserve_nl = false) { $endlessloop = 0; while ((strpos($Text, "[/quote]")!== false) and (strpos($Text, "[quote=") !== false) and (++$endlessloop < 20)) $Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism", - "
" . $t_wrote . " $2
", + "
" . $t_wrote . "
$2
", $Text); // [img=widthxheight]image source[/img] -- cgit v1.2.3