aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-19 19:12:33 -0700
committerredmatrix <git@macgirvin.com>2016-06-19 19:12:33 -0700
commitfb61c4fb3497d3751bb43f12cadee9e9c7776be9 (patch)
tree604989e10424456783fccff1fccc5b14da26db7f /include/attach.php
parentbfaabfb7b5ff639992a01b0e1fc374cd43d536e9 (diff)
parent4578649f758e65f1d87ebb98da7cd891d0b90d0d (diff)
downloadvolse-hubzilla-fb61c4fb3497d3751bb43f12cadee9e9c7776be9.tar.gz
volse-hubzilla-fb61c4fb3497d3751bb43f12cadee9e9c7776be9.tar.bz2
volse-hubzilla-fb61c4fb3497d3751bb43f12cadee9e9c7776be9.zip
Merge branch '1.8RC'
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php30
1 files changed, 14 insertions, 16 deletions
diff --git a/include/attach.php b/include/attach.php
index ae4681994..78efde51f 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -720,7 +720,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$edited = $created;
if($options === 'replace') {
- $r = q("update attach set filename = '%s', filetype = '%s', folder = '%s', filesize = %d, os_storage = %d, is_photo = %d, data = '%s', edited = '%s' where id = %d and uid = %d",
+ $r = q("update attach set filename = '%s', filetype = '%s', folder = '%s', filesize = %d, os_storage = %d, is_photo = %d, content = '%s', edited = '%s' where id = %d and uid = %d",
dbesc($filename),
dbesc($mimetype),
dbesc($folder_hash),
@@ -734,7 +734,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
);
}
elseif($options === 'revise') {
- $r = q("insert into attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, data, created, edited, allow_cid, allow_gid, deny_cid, deny_gid )
+ $r = q("insert into attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, content, created, edited, allow_cid, allow_gid, deny_cid, deny_gid )
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
intval($x[0]['aid']),
intval($channel_id),
@@ -775,7 +775,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
}
else {
- $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, data, created, edited, allow_cid, allow_gid,deny_cid, deny_gid )
+ $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, content, created, edited, allow_cid, allow_gid,deny_cid, deny_gid )
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
intval($channel['channel_account_id']),
intval($channel_id),
@@ -1032,7 +1032,7 @@ function attach_mkdir($channel, $observer_hash, $arr = null) {
$created = datetime_convert();
- $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, filetype, filesize, revision, folder, os_storage, is_dir, data, created, edited, allow_cid, allow_gid, deny_cid, deny_gid )
+ $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, filetype, filesize, revision, folder, os_storage, is_dir, content, created, edited, allow_cid, allow_gid, deny_cid, deny_gid )
VALUES ( %d, %d, '%s', '%s', '%s', '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
intval($channel['channel_account_id']),
intval($channel_id),
@@ -1275,16 +1275,16 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
// delete a file from filesystem
if(intval($r[0]['os_storage'])) {
- $y = q("SELECT data FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1",
+ $y = q("SELECT content FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1",
dbesc($resource),
intval($channel_id)
);
if($y) {
- if(strpos($y[0]['data'],'store') === false)
- $f = 'store/' . $channel_address . '/' . $y[0]['data'];
+ if(strpos($y[0]['content'],'store') === false)
+ $f = 'store/' . $channel_address . '/' . $y[0]['content'];
else
- $f = $y[0]['data'];
+ $f = $y[0]['content'];
if(is_dir($f))
@rmdir($f);
@@ -1585,13 +1585,13 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
$arr['deny_gid'] = perms2str($u_arr_deny_gid);
$arr['item_private'] = $private;
$arr['verb'] = ACTIVITY_UPDATE;
- $arr['object'] = $u_jsonobject;
+ $arr['obj'] = $u_jsonobject;
$arr['body'] = '';
$post = item_store($arr);
$item_id = $post['item_id'];
if($item_id) {
- proc_run('php',"include/notifier.php","activity",$item_id);
+ Zotlabs\Daemon\Master::Summon(array('Notifier','activity',$item_id));
}
call_hooks('post_local_end', $arr);
@@ -1620,14 +1620,14 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
$arr['deny_gid'] = perms2str($arr_deny_gid);
$arr['item_private'] = $private;
$arr['verb'] = (($update) ? ACTIVITY_UPDATE : ACTIVITY_POST);
- $arr['object'] = (($update) ? $u_jsonobject : $jsonobject);
+ $arr['obj'] = (($update) ? $u_jsonobject : $jsonobject);
$arr['body'] = '';
$post = item_store($arr);
$item_id = $post['item_id'];
if($item_id) {
- proc_run('php',"include/notifier.php","activity",$item_id);
+ Zotlabs\Daemon\Master::Summon(array('Notifier','activity',$item_id));
}
call_hooks('post_local_end', $arr);
@@ -1854,21 +1854,19 @@ function attach_export_data($channel, $resource_id, $deleted = false) {
} while($hash_ptr);
-
-
$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",
+ $r = q("select * from photo where resource_id = '%s' and uid = %d order by imgscale asc",
dbesc($resource_id),
intval($channel['channel_id'])
);
if($r) {
for($x = 0; $x < count($r); $x ++) {
- $r[$x]['data'] = base64_encode($r[$x]['data']);
+ $r[$x]['content'] = base64_encode($r[$x]['content']);
}
$ret['photo'] = $r;
}