aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-10-20 09:36:15 +0200
committerMario Vavti <mario@mariovavti.com>2015-10-20 09:36:15 +0200
commitf7601756e99fcedb062d1f7ac3e53431ea72642d (patch)
tree5aae7959b0b2d16fc7e374335ddc85984b9a482d /include/bb2diaspora.php
parent54059b2f153433f7154a754a77dafba1cc97a1a2 (diff)
downloadvolse-hubzilla-f7601756e99fcedb062d1f7ac3e53431ea72642d.tar.gz
volse-hubzilla-f7601756e99fcedb062d1f7ac3e53431ea72642d.tar.bz2
volse-hubzilla-f7601756e99fcedb062d1f7ac3e53431ea72642d.zip
create photo object if feature large photos is enabled and display those slightly different
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 692128087..95de43ec3 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -305,6 +305,21 @@ 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);
+ $photo = array(
+ 'url' => rawurldecode($object['id']),
+ 'link' => rawurldecode(get_rel_link($object['link'],'alternate')),
+ 'width' => $object['width'],
+ 'height' => $object['height']
+ );
+
+ $photo_bb = '[zrl=' . $photo['link'] . ']' . '[zmg=' . $photo['width'] . 'x' . $photo['height'] . ']' . $photo['url'] . '[/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) {