Some small improvements to the OStatus export

This commit is contained in:
Michael Vogel 2015-11-27 23:16:54 +01:00
parent 5fe8ae514b
commit a9b2b48d08
3 changed files with 13 additions and 4 deletions

View file

@ -100,7 +100,7 @@ function bb_attachment($Text, $simplehtml = false, $tryoembed = true) {
} }
if ($simplehtml == 7) if ($simplehtml == 7)
$text = sprintf('<a href="%s" title="%s" class="attachment thumbnail" rel="nofollow external">%s</a>', $text = sprintf('<a href="%s" title="%s" class="attachment thumbnail" rel="nofollow external">%s</a><br />',
$url, $title, $title); $url, $title, $title);
elseif (($simplehtml != 4) AND ($simplehtml != 0)) elseif (($simplehtml != 4) AND ($simplehtml != 0))
$text = sprintf('<a href="%s" target="_blank">%s</a><br>', $url, $title); $text = sprintf('<a href="%s" target="_blank">%s</a><br>', $url, $title);

View file

@ -4645,7 +4645,7 @@ function item_getfeedtags($item) {
if($cnt) { if($cnt) {
for($x = 0; $x < $cnt; $x ++) { for($x = 0; $x < $cnt; $x ++) {
if($matches[1][$x]) if($matches[1][$x])
$ret[] = array('#',$matches[1][$x], $matches[2][$x]); $ret[$matches[2][$x]] = array('#',$matches[1][$x], $matches[2][$x]);
} }
} }
$matches = false; $matches = false;

View file

@ -1201,6 +1201,14 @@ function ostatus_get_attachment($doc, $root, $item) {
break; break;
} }
if (($siteinfo["type"] != "photo") AND isset($siteinfo["image"])) {
$photodata = get_photo_info($siteinfo["image"]);
$attributes = array("rel" => "preview", "href" => $siteinfo["image"], "media:width" => $photodata[0], "media:height" => $photodata[1]);
xml_add_element($doc, $root, "link", "", $attributes);
}
$arr = explode('[/attach],',$item['attach']); $arr = explode('[/attach],',$item['attach']);
if(count($arr)) { if(count($arr)) {
foreach($arr as $r) { foreach($arr as $r) {
@ -1327,6 +1335,7 @@ function ostatus_entry($doc, $item, $owner, $toplevel = false) {
if ($item['title'] != "") if ($item['title'] != "")
$body = "[b]".$item['title']."[/b]\n\n".$body; $body = "[b]".$item['title']."[/b]\n\n".$body;
$body = bb_remove_share_information($body);
$body = bbcode($body, false, false, 7); $body = bbcode($body, false, false, 7);
xml_add_element($doc, $entry, "content", $body, array("type" => "html")); xml_add_element($doc, $entry, "content", $body, array("type" => "html"));
@ -1440,7 +1449,7 @@ function ostatus_feed(&$a, $owner_nick, $last_update) {
$root->appendChild($entry); $root->appendChild($entry);
} }
return($doc->saveXML()); return(trim($doc->saveXML()));
} }
function ostatus_salmon($item,$owner) { function ostatus_salmon($item,$owner) {
@ -1452,6 +1461,6 @@ function ostatus_salmon($item,$owner) {
$doc->appendChild($entry); $doc->appendChild($entry);
return($doc->saveXML()); return(trim($doc->saveXML()));
} }
?> ?>