mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:55:19 +00:00
fix sharing of photo items
This commit is contained in:
parent
02527552fd
commit
3f1dc22c0e
2 changed files with 15 additions and 8 deletions
|
@ -292,18 +292,19 @@ function photo_upload($channel, $observer, $args) {
|
|||
$tag = (($r2) ? '[zmg=' . $width . 'x' . $height . ']' : '[zmg]');
|
||||
}
|
||||
|
||||
$body = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']'
|
||||
. $tag . z_root() . "/photo/{$photo_hash}-{$scale}." . $ph->getExt() . '[/zmg]'
|
||||
. '[/zrl]';
|
||||
|
||||
// Create item object
|
||||
$object = array(
|
||||
'type' => ACTIVITY_OBJ_PHOTO,
|
||||
'title' => $title,
|
||||
'id' => rawurlencode(z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash),
|
||||
'link' => $link
|
||||
'link' => $link,
|
||||
'bbcode' => $body
|
||||
);
|
||||
|
||||
$body = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']'
|
||||
. $tag . z_root() . "/photo/{$photo_hash}-{$scale}." . $ph->getExt() . '[/zmg]'
|
||||
. '[/zrl]';
|
||||
|
||||
// Create item container
|
||||
if($args['item']) {
|
||||
foreach($args['item'] as $i) {
|
||||
|
|
|
@ -42,6 +42,12 @@ function share_init(&$a) {
|
|||
|
||||
xchan_query($r);
|
||||
|
||||
$is_photo = (($r[0]['obj_type'] === ACTIVITY_OBJ_PHOTO) ? true : false);
|
||||
if($is_photo) {
|
||||
$object = json_decode($r[0]['object'],true);
|
||||
$photo_bb = $object['bbcode'];
|
||||
}
|
||||
|
||||
if (strpos($r[0]['body'], "[/share]") !== false) {
|
||||
$pos = strpos($r[0]['body'], "[share");
|
||||
$o = substr($r[0]['body'], $pos);
|
||||
|
@ -53,9 +59,9 @@ function share_init(&$a) {
|
|||
"' posted='".$r[0]['created'].
|
||||
"' message_id='".$r[0]['mid']."']";
|
||||
if($r[0]['title'])
|
||||
$o .= '[b]'.$r[0]['title'].'[/b]'."\n";
|
||||
$o .= $r[0]['body'];
|
||||
$o.= "[/share]";
|
||||
$o .= '[b]'.$r[0]['title'].'[/b]'."\r\n";
|
||||
$o .= (($is_photo) ? $r[0]['body'] . "\r\n" . $photo_bb : $r[0]['body']);
|
||||
$o .= "[/share]";
|
||||
}
|
||||
|
||||
if(local_channel()) {
|
||||
|
|
Loading…
Reference in a new issue