diff options
author | mrjive <mrjive@mrjive.it> | 2015-10-26 21:55:47 +0100 |
---|---|---|
committer | mrjive <mrjive@mrjive.it> | 2015-10-26 21:55:47 +0100 |
commit | a4c3058f845a1c38d06b2201a10700c5f878366d (patch) | |
tree | bab86468397e523457ba25199cb9a67265980e00 /include/bb2diaspora.php | |
parent | 32522b61f235266384c81c0669fceaf58afeb4fe (diff) | |
parent | 6cb7afcbc0447b60de0128f9a912e10ae125ba45 (diff) | |
download | volse-hubzilla-a4c3058f845a1c38d06b2201a10700c5f878366d.tar.gz volse-hubzilla-a4c3058f845a1c38d06b2201a10700c5f878366d.tar.bz2 volse-hubzilla-a4c3058f845a1c38d06b2201a10700c5f878366d.zip |
Merge pull request #7 from redmatrix/master
updating from original codebase
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r-- | include/bb2diaspora.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 692128087..d10ed57eb 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -305,6 +305,16 @@ function bb2diaspora_itembody($item, $force_update = false) { $matches = array(); + //if we have a photo item just prepend the photo bbcode to item['body'] + $is_photo = (($item['obj_type'] == ACTIVITY_OBJ_PHOTO) ? true : false); + if($is_photo) { + $object = json_decode($item['object'],true); + if($object['link'][2]) { + $photo_bb = '[zrl=' . rawurldecode($object['id']) . ']' . '[zmg=' . $object['link'][2]['width'] . 'x' . $object['link'][2]['height'] . ']' . rawurldecode($object['link'][2]['href']) . '[/zmg]' . '[/zrl]'; + $item['body'] = (($item['body']) ? $photo_bb . $item['body'] : $photo_bb); + } + } + if(($item['diaspora_meta']) && (! $force_update)) { $diaspora_meta = json_decode($item['diaspora_meta'],true); if($diaspora_meta) { |