issue #519 continued
This commit is contained in:
parent
be6c4019f6
commit
9981cbb72c
@ -709,6 +709,9 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
|
|||||||
|
|
||||||
$os_relpath .= $hash;
|
$os_relpath .= $hash;
|
||||||
|
|
||||||
|
// not yet used
|
||||||
|
$os_path = '';
|
||||||
|
|
||||||
if($src)
|
if($src)
|
||||||
@file_put_contents($os_basepath . $os_relpath,@file_get_contents($src));
|
@file_put_contents($os_basepath . $os_relpath,@file_get_contents($src));
|
||||||
|
|
||||||
@ -723,7 +726,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
|
|||||||
$edited = $created;
|
$edited = $created;
|
||||||
|
|
||||||
if($options === 'replace') {
|
if($options === 'replace') {
|
||||||
$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",
|
$r = q("update attach set filename = '%s', filetype = '%s', folder = '%s', filesize = %d, os_storage = %d, is_photo = %d, content = '%s', edited = '%s', os_path = '%s' where id = %d and uid = %d",
|
||||||
dbesc($filename),
|
dbesc($filename),
|
||||||
dbesc($mimetype),
|
dbesc($mimetype),
|
||||||
dbesc($folder_hash),
|
dbesc($folder_hash),
|
||||||
@ -732,13 +735,14 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
|
|||||||
intval($is_photo),
|
intval($is_photo),
|
||||||
dbesc($os_basepath . $os_relpath),
|
dbesc($os_basepath . $os_relpath),
|
||||||
dbesc($created),
|
dbesc($created),
|
||||||
|
dbesc($os_path),
|
||||||
intval($existing_id),
|
intval($existing_id),
|
||||||
intval($channel_id)
|
intval($channel_id)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif($options === 'revise') {
|
elseif($options === 'revise') {
|
||||||
$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 )
|
$r = q("insert into attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, content, created, edited, os_path, 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' ) ",
|
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
|
||||||
intval($x[0]['aid']),
|
intval($x[0]['aid']),
|
||||||
intval($channel_id),
|
intval($channel_id),
|
||||||
dbesc($x[0]['hash']),
|
dbesc($x[0]['hash']),
|
||||||
@ -753,6 +757,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
|
|||||||
dbesc($os_basepath . $os_relpath),
|
dbesc($os_basepath . $os_relpath),
|
||||||
dbesc($created),
|
dbesc($created),
|
||||||
dbesc($created),
|
dbesc($created),
|
||||||
|
dbesc($os_path),
|
||||||
dbesc($x[0]['allow_cid']),
|
dbesc($x[0]['allow_cid']),
|
||||||
dbesc($x[0]['allow_gid']),
|
dbesc($x[0]['allow_gid']),
|
||||||
dbesc($x[0]['deny_cid']),
|
dbesc($x[0]['deny_cid']),
|
||||||
@ -760,7 +765,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif($options === 'update') {
|
elseif($options === 'update') {
|
||||||
$r = q("update attach set filename = '%s', filetype = '%s', folder = '%s', edited = '%s', os_storage = %d, is_photo = %d,
|
$r = q("update attach set filename = '%s', filetype = '%s', folder = '%s', edited = '%s', os_storage = %d, is_photo = %d, os_path = '%s',
|
||||||
allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' where id = %d and uid = %d",
|
allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' where id = %d and uid = %d",
|
||||||
dbesc((array_key_exists('filename',$arr)) ? $arr['filename'] : $x[0]['filename']),
|
dbesc((array_key_exists('filename',$arr)) ? $arr['filename'] : $x[0]['filename']),
|
||||||
dbesc((array_key_exists('filetype',$arr)) ? $arr['filetype'] : $x[0]['filetype']),
|
dbesc((array_key_exists('filetype',$arr)) ? $arr['filetype'] : $x[0]['filetype']),
|
||||||
@ -768,6 +773,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
|
|||||||
dbesc($created),
|
dbesc($created),
|
||||||
dbesc((array_key_exists('os_storage',$arr)) ? $arr['os_storage'] : $x[0]['os_storage']),
|
dbesc((array_key_exists('os_storage',$arr)) ? $arr['os_storage'] : $x[0]['os_storage']),
|
||||||
dbesc((array_key_exists('is_photo',$arr)) ? $arr['is_photo'] : $x[0]['is_photo']),
|
dbesc((array_key_exists('is_photo',$arr)) ? $arr['is_photo'] : $x[0]['is_photo']),
|
||||||
|
dbesc((array_key_exists('os_path',$arr)) ? $arr['os_path'] : $x[0]['os_path']),
|
||||||
dbesc((array_key_exists('allow_cid',$arr)) ? $arr['allow_cid'] : $x[0]['allow_cid']),
|
dbesc((array_key_exists('allow_cid',$arr)) ? $arr['allow_cid'] : $x[0]['allow_cid']),
|
||||||
dbesc((array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : $x[0]['allow_gid']),
|
dbesc((array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : $x[0]['allow_gid']),
|
||||||
dbesc((array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : $x[0]['deny_cid']),
|
dbesc((array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : $x[0]['deny_cid']),
|
||||||
@ -778,7 +784,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
$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 )
|
$r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, content, created, edited, os_path, 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' ) ",
|
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['channel_account_id']),
|
||||||
intval($channel_id),
|
intval($channel_id),
|
||||||
@ -794,6 +800,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
|
|||||||
dbesc($os_basepath . $os_relpath),
|
dbesc($os_basepath . $os_relpath),
|
||||||
dbesc($created),
|
dbesc($created),
|
||||||
dbesc($created),
|
dbesc($created),
|
||||||
|
dbesc($os_path),
|
||||||
dbesc(($arr && array_key_exists('allow_cid',$arr)) ? $arr['allow_cid'] : $str_contact_allow),
|
dbesc(($arr && array_key_exists('allow_cid',$arr)) ? $arr['allow_cid'] : $str_contact_allow),
|
||||||
dbesc(($arr && array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : $str_group_allow),
|
dbesc(($arr && array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : $str_group_allow),
|
||||||
dbesc(($arr && array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : $str_contact_deny),
|
dbesc(($arr && array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : $str_contact_deny),
|
||||||
|
Reference in New Issue
Block a user