From a6742d3db65b5ad430ba83d9f752931458861bc2 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 11 May 2014 22:07:37 +0200 Subject: [PATCH] Repeated messages to Diaspora now contain a link to the original content at the bottom of the message. --- .gitignore | 1 + include/bbcode.php | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 715283359..655df82c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ favicon.* .htconfig.php +.htpreconfig.php \#* include/jquery-1.4.2.min.js *.log diff --git a/include/bbcode.php b/include/bbcode.php index 267834403..686bd41b8 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -386,22 +386,19 @@ function bb_ShareAttributesDiaspora($match) { if ($matches[1] != "") $profile = $matches[1]; - $posted = ""; -// preg_match("/posted='(.*?)'/ism", $attributes, $matches); -// if ($matches[1] != "") -// $posted = " ".date("Y-m-d H:i", strtotime($matches[1])); -// -// preg_match('/posted="(.*?)"/ism', $attributes, $matches); -// if ($matches[1] != "") -// $posted = " ".date("Y-m-d H:i", strtotime($matches[1])); + $link = ""; + preg_match("/link='(.*?)'/ism", $attributes, $matches); + if ($matches[1] != "") + $link = $matches[1]; + + preg_match('/link="(.*?)"/ism', $attributes, $matches); + if ($matches[1] != "") + $link = $matches[1]; $userid = GetProfileUsername($profile,$author); $headline = '
'; $headline .= ''.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').$userid.':'; - //$headline .= sprintf(t(''. - // html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8'). - // '%s%s:'), $profile, $userid, $posted); $headline .= "
"; $text = trim($match[1]); @@ -410,7 +407,11 @@ function bb_ShareAttributesDiaspora($match) { $text .= "
"; $text .= $headline.'
'.trim($match[3])."

"; - //$text .= $headline."
".trim($match[3])."
"; + + if ($link != "") + $text .= '
[l]'; + + // $text .= '
'.t("Link").' [l]'; return($text); }