diff options
author | redmatrix <git@macgirvin.com> | 2016-04-06 18:07:29 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-04-06 18:07:29 -0700 |
commit | 29363a185dea07dbb035ccdc027a48881d8e96fd (patch) | |
tree | ba03fa88f7f990d368faa6fb639f4231bfee2ccf /include/attach.php | |
parent | a20ef706fd6e7011a0dc95df71222b9a5871e3b3 (diff) | |
download | volse-hubzilla-29363a185dea07dbb035ccdc027a48881d8e96fd.tar.gz volse-hubzilla-29363a185dea07dbb035ccdc027a48881d8e96fd.tar.bz2 volse-hubzilla-29363a185dea07dbb035ccdc027a48881d8e96fd.zip |
file sync work
Diffstat (limited to 'include/attach.php')
-rw-r--r-- | include/attach.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/attach.php b/include/attach.php index 69adbc546..b6b56db34 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1843,16 +1843,27 @@ function attach_export_data($channel,$resource_id) { $paths[] = $r[0]; } while($hash_ptr); + + $ret['fetch_url'] = z_root() . '/getfile'; + $ret['original_channel'] = $channel['channel_address']; + + $paths = array_reverse($paths); $ret['attach'] = $paths; + if($attach_ptr['is_photo']) { $r = q("select * from photo where resource_id = '%s' and uid = %d order by scale asc", dbesc($resource_id), intval($channel['channel_id']) ); - $ret['photo'] = $r; + if($r) { + foreach($r as $rr) { + $rr['data'] = base64_encode($rr['data']); + } + $ret['photo'] = $r; + } $r = q("select * from item where resource_id = '%s' and resource_type = 'photo' and uid = %d ", dbesc($resource_id), @@ -1874,4 +1885,16 @@ function attach_export_data($channel,$resource_id) { return $ret; +} + + +/* strip off 'store/nickname/' from the provided path */ + +function get_attach_binname($s) { + $p = $s; + if(strpos($s,'store/') === 0) { + $p = substr($s,6); + $p = substr($p,strpos($p,'/')+1); + } + return $p; }
\ No newline at end of file |