diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-08-26 22:14:19 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-08-26 22:14:19 -0700 |
commit | 2bce61d18bcba2f03be3cd9f7129c4d4053213b6 (patch) | |
tree | 00b5efba6ff98c667c74812b4eb15867d06e44f0 /include/api.php | |
parent | 9cebd249871389bb756cb4d73e6719200120e413 (diff) | |
parent | 0d2c90cc2e4df2b5a7dc83c735ea60bd77c6946e (diff) | |
download | volse-hubzilla-2bce61d18bcba2f03be3cd9f7129c4d4053213b6.tar.gz volse-hubzilla-2bce61d18bcba2f03be3cd9f7129c4d4053213b6.tar.bz2 volse-hubzilla-2bce61d18bcba2f03be3cd9f7129c4d4053213b6.zip |
Merge https://github.com/redmatrix/redmatrix into pending_merge
Diffstat (limited to 'include/api.php')
-rw-r--r-- | include/api.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/api.php b/include/api.php index 369992332..d352129e9 100644 --- a/include/api.php +++ b/include/api.php @@ -645,7 +645,27 @@ require_once('include/items.php'); if(array_key_exists('os_storage',$r[0]) && intval($r[0]['os_storage'])) $data = file_get_contents($data); $r[0]['data'] = base64_encode($data); - json_return_and_die($r[0]); + $ret = array('photo' => $r[0]); + $i = q("select id from item where uid = %d and resource_type = 'photo' and resource_id = '%s' limit 1", + intval(local_channel()), + dbesc($_REQUEST['photo_id']) + ); + if($i) { + $ii = q("select * from item where parent = %d order by id", + intval($i[0]['id']) + ); + if($ii) { + xchan_query($ii,true,0); + $ii = fetch_post_tags($ii,true); + if($ii) { + $ret['item'] = array(); + foreach($ii as $iii) + $ret['item'][] = encode_item($iii); + } + } + } + + json_return_and_die($ret); } killme(); } |