From 46c7cb5b721f4867b06914551a200b47c99cde41 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 24 Jul 2014 22:51:28 +0200 Subject: [PATCH] bbcode: New mode for conversion of shared content that will be used for g+ and facebook export. --- include/bbcode.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index 84969dab9f..2f4b3df77e 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -452,7 +452,7 @@ function bb_ShareAttributes($share, $simplehtml) { case 2: $text = $preshare.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').' '.$userid_compact.":
".$share[3]; break; - case 3: + case 3: // Diaspora $headline = '
'; $headline .= ''.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').$userid.':'; $headline .= "
"; @@ -484,15 +484,21 @@ function bb_ShareAttributes($share, $simplehtml) { case 5: $text = $preshare.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').' '.$userid_compact.":
".$share[3]; break; - case 6: + case 6: // app.net $text = $preshare.">> @".$userid_compact.":
".$share[3]; break; - case 7: + case 7: // statusnet/GNU Social $text = $preshare.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8')." @".$userid_compact.": ".$share[3]; break; - case 8: + case 8: // twitter $text = $preshare."RT @".$userid_compact.": ".$share[3]; break; + case 9: // Google+/Facebook + $text = $preshare.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').' '.$userid_compact.":
".$share[3]; + + if ($link != "") + $text .= "

".$link; + break; default: $headline = trim($share[1]).'
'; if ($avatar != "") @@ -775,7 +781,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal $Text = preg_replace("/#\[url\=[$URLSearchString]*\]\^\[\/url\]\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/i", "[bookmark=$1]$2[/bookmark]", $Text); - if (in_array($simplehtml, array(2, 6, 7, 8))) { + if (in_array($simplehtml, array(2, 6, 7, 8, 9))) { $Text = preg_replace_callback("/([^#@])\[url\=([^\]]*)\](.*?)\[\/url\]/ism","bb_expand_links",$Text); //$Text = preg_replace("/[^#@]\[url\=([^\]]*)\](.*?)\[\/url\]/ism",' $2 [url]$1[/url]',$Text); $Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism",' $2 [url]$1[/url]',$Text);