const BACKLINK = 8;
const ACTIVITYPUB = 9;
- const ANCHOR = '<br class="anchor">';
+ const TOP_ANCHOR = '<br class="top-anchor">';
+ const BOTTOM_ANCHOR = '<br class="button-anchor">';
/**
* Fetches attachment data that were generated the old way
*
'$guid' => $attributes['guid'],
'$network_name' => ContactSelector::networkToName($network, $attributes['profile']),
'$network_icon' => ContactSelector::networkToIcon($network, $attributes['profile']),
- '$content' => self::setMentions(trim($content), 0, $network) . self::ANCHOR,
+ '$content' => self::TOP_ANCHOR . self::setMentions(trim($content), 0, $network) . self::BOTTOM_ANCHOR,
]);
break;
}
'attachment' => $attachment,
],
]);
- $trailing .= $media;
+ // On Diaspora posts the attached pictures are leading
+ if ($item['network'] == Protocol::DIASPORA) {
+ $leading .= $media;
+ } else {
+ $trailing .= $media;
+ }
}
}
if ($shared) {
- $content = str_replace(BBCode::ANCHOR, '<div class="body-attach">' . $leading . '<div class="clear"></div></div>' . BBCode::ANCHOR, $content);
- $content = str_replace(BBCode::ANCHOR, BBCode::ANCHOR . '<div class="body-attach">' . $trailing . '<div class="clear"></div></div>', $content);
+ $content = str_replace(BBCode::TOP_ANCHOR, '<div class="body-attach">' . $leading . '<div class="clear"></div></div>' . BBCode::TOP_ANCHOR, $content);
+ $content = str_replace(BBCode::BOTTOM_ANCHOR, '<div class="body-attach">' . $trailing . '<div class="clear"></div></div>' . BBCode::BOTTOM_ANCHOR, $content);
} else {
if ($leading != '') {
$content = '<div class="body-attach">' . $leading . '<div class="clear"></div></div>' . $content;
// @todo Use a template
$rendered = BBCode::convertAttachment('', BBCode::INTERNAL, false, $data);
if ($shared) {
- return str_replace(BBCode::ANCHOR, BBCode::ANCHOR . $rendered, $content);
+ return str_replace(BBCode::BOTTOM_ANCHOR, BBCode::BOTTOM_ANCHOR . $rendered, $content);
} else {
return $content . $rendered;
}