aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorMichael Vogel <icarus@dabo.de>2012-03-17 12:15:59 +0100
committerMichael Vogel <icarus@dabo.de>2012-03-17 12:15:59 +0100
commitf5db142d93906d9fd33ddcd75dfa56ec90ce3b9e (patch)
treee4c30f54f6844ccb55a4dac8dd7120175180afa1 /include/bbcode.php
parent8a1f175df022e2fc2c2162aa314ea34454482d48 (diff)
downloadvolse-hubzilla-f5db142d93906d9fd33ddcd75dfa56ec90ce3b9e.tar.gz
volse-hubzilla-f5db142d93906d9fd33ddcd75dfa56ec90ce3b9e.tar.bz2
volse-hubzilla-f5db142d93906d9fd33ddcd75dfa56ec90ce3b9e.zip
Quotes with author are now having an "open/close" link
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php13
1 files changed, 12 insertions, 1 deletions
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",
+ "<br /><strong class=".'"spoiler"'.">" . $t_wrote . "</strong><blockquote class=".'"spoiler"'.">$2</blockquote>",
+ $Text);
+
// Declare the format for [quote] layout
$QuoteLayout = '<blockquote>$1</blockquote>';
@@ -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",
- "<blockquote><strong>" . $t_wrote . "</strong> $2</blockquote>",
+ "<br /><strong class=".'"author"'.">" . $t_wrote . "</strong><blockquote class=".'"author"'.">$2</blockquote>",
$Text);
// [img=widthxheight]image source[/img]