diff options
author | redmatrix <git@macgirvin.com> | 2016-06-01 21:48:54 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-06-01 21:48:54 -0700 |
commit | a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2 (patch) | |
tree | de0ac6910e13926df60cfed458e50310c5642055 /include/attach.php | |
parent | b1259876bf398880e7b0c1b44d90f94983243e72 (diff) | |
download | volse-hubzilla-a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2.tar.gz volse-hubzilla-a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2.tar.bz2 volse-hubzilla-a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2.zip |
the rest of the schema updates - WARNING: some third party plugins may fail; e.g. embedphotos and chess. $item['object'] is now $item['obj'] and $photo['type'] is $photo['mimetype'], $photo['scale'] is $photo['imgscale'] and $photo['data'] is now $photo['content']. There are a number of other changes, but these are the ones noted to cause issues with third-party plugins. The project plugins have been updated. Please note any new issues as this effort touched a lot of code in a lot of files.
Diffstat (limited to 'include/attach.php')
-rw-r--r-- | include/attach.php | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/include/attach.php b/include/attach.php index d9cd30f6d..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,7 +1585,7 @@ 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); @@ -1620,7 +1620,7 @@ 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); @@ -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; } |