Some design changes to repeated items in "vier".
if ($avatar != "")
$headline .= '<img src="'.$avatar.'" height="32" width="32" >';
- $headline .= sprintf(t('<span><a href="%s">%s</a> wrote the following <a href="%s">post</a>:</span>'), $profile, $author, $link);
+ $headline .= sprintf(t('<span><a href="%s" target="external-link">%s</a> wrote the following <a href="%s" target="external-link">post</a>:</span>'), $profile, $author, $link);
$headline .= "</div>";
- $text = "<br />".$headline.'<blockquote class="shared_content">'.trim($match[2])."</blockquote>";
+ $text = $headline.'<blockquote class="shared_content">'.trim($match[2])."</blockquote>";
return($text);
}
// We'll emulate it.
+ $Text = trim($Text);
$Text = str_replace("\r\n","\n", $Text);
$Text = str_replace(array("\r","\n"), array('<br />','<br />'), $Text);
}
if(! $it)
break;
-
+
$local_user = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
intval($uid)
);
if(! count($local_user))
break;
-
+
$reply_to = '';
$r1 = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval($uid)
if($it['uri'] !== $it['parent-uri']) {
$headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n";
- if(!strlen($it['title'])) {
- $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' LIMIT 1",
- dbesc($it['parent-uri']));
+ if(!$it['title']) {
+ $r = q("SELECT `title` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ dbesc($it['parent-uri']),
+ intval($uid));
if(count($r) AND ($r[0]['title'] != ''))
$subject = $r[0]['title'];
+ else {
+ $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d LIMIT 1",
+ dbesc($it['parent-uri']),
+ intval($uid));
+
+ if(count($r) AND ($r[0]['title'] != ''))
+ $subject = $r[0]['title'];
+ }
}
if(strncasecmp($subject,'RE:',3))
$subject = 'Re: '.$subject;
$orig_guid = notags(unxmlify($xml->root_guid));
$source_url = 'https://' . substr($orig_author,strpos($orig_author,'@')+1) . '/p/' . $orig_guid . '.xml';
+ $orig_url = 'https://'.substr($orig_author,strpos($orig_author,'@')+1).'/posts/'.$orig_guid;
$x = fetch_url($source_url);
if(! $x)
$x = fetch_url(str_replace('https://','http://',$source_url));
$datarray['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
$datarray['body'] = $body;
} else {
+ $prefix = "[share author='".$person['name'].
+ "' profile='".$person['url'].
+ "' avatar='".((x($person,'thumb')) ? $person['thumb'] : $person['photo']).
+ "' link='".$orig_url."']";
$datarray['author-name'] = $contact['name'];
$datarray['author-link'] = $contact['url'];
$datarray['author-avatar'] = $contact['thumb'];
- $datarray['body'] = $prefix . $body;
+ $datarray['body'] = $prefix.$body."[/share]";
}
$datarray['tag'] = $str_tags;
logger('get_atom_elements: Looking for status.net repeated message');
$message = $child["http://activitystrea.ms/spec/1.0/"]["object"][0]["child"][SIMPLEPIE_NAMESPACE_ATOM_10]["content"][0]["data"];
+ $orig_uri = $child["http://activitystrea.ms/spec/1.0/"]["object"][0]["child"][SIMPLEPIE_NAMESPACE_ATOM_10]["id"][0]["data"];
$author = $child[SIMPLEPIE_NAMESPACE_ATOM_10]["author"][0]["child"][SIMPLEPIE_NAMESPACE_ATOM_10];
$uri = $author["uri"][0]["data"];
$name = $author["name"][0]["data"];
$avatar = $avatar["href"];
if (($name != "") and ($uri != "") and ($avatar != "") and ($message != "")) {
- logger('get_atom_elements: fixing sender of repeated message');
+ logger('get_atom_elements: fixing sender of repeated message. '.print_r($child, true));
- $res["owner-name"] = $res["author-name"];
+ /*$res["owner-name"] = $res["author-name"];
$res["owner-link"] = $res["author-link"];
$res["owner-avatar"] = $res["author-avatar"];
$res["author-name"] = $name;
$res["author-link"] = $uri;
- $res["author-avatar"] = $avatar;
+ $res["author-avatar"] = $avatar;*/
- $res["body"] = html2bbcode($message);
+ $prefix = "[share author='".$name.
+ "' profile='".$uri.
+ "' avatar='".$avatar.
+ "' link='".$orig_uri."']";
+
+ $res["body"] = $prefix.html2bbcode($message)."[/share]";
}
}
if($it['uri'] !== $it['parent-uri']) {
$headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n";
- if(!strlen($it['title'])) {
- $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' LIMIT 1",
- dbesc($it['parent-uri']));
+ if(!$it['title']) {
+ $r = q("SELECT `title` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ dbesc($it['parent-uri']),
+ intval($uid));
- if(count($r) AND ($r[0]['title'] != ''))
+ if(count($r) AND ($r[0]['title'] != ''))
$subject = $r[0]['title'];
+ else {
+ $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d LIMIT 1",
+ dbesc($it['parent-uri']),
+ intval($uid));
+
+ if(count($r) AND ($r[0]['title'] != ''))
+ $subject = $r[0]['title'];
+ }
}
if(strncasecmp($subject,'RE:',3))
$subject = 'Re: '.$subject;
// If it seems to be a reply but a header couldn't be found take the last message with matching subject
if(!x($datarray,'parent-uri') and $reply) {
- $r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE MATCH (`title`) AGAINST ('".'"%s"'."' IN BOOLEAN MODE) ORDER BY `created` DESC LIMIT 1",
- dbesc(protect_sprintf($datarray['title'])));
+ $r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE MATCH (`title`) AGAINST ('".'"%s"'."' IN BOOLEAN MODE) AND `uid` = %d ORDER BY `created` DESC LIMIT 1",
+ dbesc(protect_sprintf($datarray['title'])),
+ intval($importer_uid));
if(count($r))
$datarray['parent-uri'] = $r[0]['parent-uri'];
}
$s = $prep_arr['html'];
if(! $attach) {
+ // Replace the blockquotes with quotes that are used in mails
+ $mailquote = '<blockquote type="cite" class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">';
+ $s = str_replace(array('<blockquote>', '<blockquote class="spoiler">', '<blockquote class="author">'), array($mailquote, $mailquote, $mailquote), $s);
return $s;
}
$a->strings["OEmbed settings updated"] = "OEmbed Einstellungen aktualisiert.";
$a->strings["Use OEmbed for YouTube videos"] = "OEmbed für Youtube Videos verwenden";
$a->strings["URL to embed:"] = "URL zum Einbetten:";
+$a->strings['<span><a href="%s" target="external-link">%s</a> wrote the following <a href="%s" target="external-link">post</a>:</span>'] =
+ '<span><a href="%s" target="external-link">%s</a> hat diesen <a href="%s" target="external-link">Beitrag</a> ursprünglich gepostet:</span>';
height: 32px;
color: #999;
border-top: 1px solid #D2D2D2;
- padding-top: 16px;
- margin-top: 16px;
+ padding-top: 5px;
+ margin-top: 5px;
}
.shared_header img {