Merge pull request #966 from annando/master

Repeated messages to Diaspora now contain a link to the original content at the bottom of the message.
This commit is contained in:
Tobias Diekershoff 2014-05-12 06:58:06 +02:00
commit bd2dd90d0a
2 changed files with 14 additions and 12 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
favicon.* favicon.*
.htconfig.php .htconfig.php
.htpreconfig.php
\#* \#*
include/jquery-1.4.2.min.js include/jquery-1.4.2.min.js
*.log *.log

View file

@ -386,22 +386,19 @@ function bb_ShareAttributesDiaspora($match) {
if ($matches[1] != "") if ($matches[1] != "")
$profile = $matches[1]; $profile = $matches[1];
$posted = ""; $link = "";
// preg_match("/posted='(.*?)'/ism", $attributes, $matches); preg_match("/link='(.*?)'/ism", $attributes, $matches);
// if ($matches[1] != "") if ($matches[1] != "")
// $posted = " ".date("Y-m-d H:i", strtotime($matches[1])); $link = $matches[1];
//
// preg_match('/posted="(.*?)"/ism', $attributes, $matches); preg_match('/link="(.*?)"/ism', $attributes, $matches);
// if ($matches[1] != "") if ($matches[1] != "")
// $posted = " ".date("Y-m-d H:i", strtotime($matches[1])); $link = $matches[1];
$userid = GetProfileUsername($profile,$author); $userid = GetProfileUsername($profile,$author);
$headline = '<div class="shared_header">'; $headline = '<div class="shared_header">';
$headline .= '<span><b>'.html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8').$userid.':</b></span>'; $headline .= '<span><b>'.html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8').$userid.':</b></span>';
//$headline .= sprintf(t('<span><b>'.
// html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8').
// '<a href="%s" target="_blank">%s</a>%s:</b></span>'), $profile, $userid, $posted);
$headline .= "</div>"; $headline .= "</div>";
$text = trim($match[1]); $text = trim($match[1]);
@ -410,7 +407,11 @@ function bb_ShareAttributesDiaspora($match) {
$text .= "<hr />"; $text .= "<hr />";
$text .= $headline.'<blockquote class="shared_content">'.trim($match[3])."</blockquote><br />"; $text .= $headline.'<blockquote class="shared_content">'.trim($match[3])."</blockquote><br />";
//$text .= $headline."<br />".trim($match[3])."<br />";
if ($link != "")
$text .= '<br /><a href="'.$link.'">[l]</a>';
// $text .= '<br /><a href="'.$link.'">'.t("Link").' [l]</a>';
return($text); return($text);
} }