diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-06-13 13:34:04 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2019-06-13 13:34:04 +0200 |
commit | 801ab611ede45921d1d6869fa65fc3fbf941d666 (patch) | |
tree | 9b1f8f24dbd525bd99152a8f58f4e2a384f63ba7 /include/attach.php | |
parent | bc34167c8490c2dad5fcd6553b27b5df54449c39 (diff) | |
download | volse-hubzilla-801ab611ede45921d1d6869fa65fc3fbf941d666.tar.gz volse-hubzilla-801ab611ede45921d1d6869fa65fc3fbf941d666.tar.bz2 volse-hubzilla-801ab611ede45921d1d6869fa65fc3fbf941d666.zip |
more work on linked item/resource deletion for photos and events, deprecate the force flag in drop_item() and comment out goaway() in drop_item().
Diffstat (limited to 'include/attach.php')
-rw-r--r-- | include/attach.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/attach.php b/include/attach.php index f169e0669..80efe0838 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1514,12 +1514,15 @@ function attach_delete($channel_id, $resource, $is_photo = 0) { function attach_drop_photo($channel_id,$resource) { - $x = q("select id, item_hidden from item where resource_id = '%s' and resource_type = 'photo' and uid = %d", + $x = q("select id, item_hidden from item where resource_id = '%s' and resource_type = 'photo' and uid = %d and item_deleted = 0", dbesc($resource), intval($channel_id) ); + if($x) { - drop_item($x[0]['id'],false,(($x[0]['item_hidden']) ? DROPITEM_NORMAL : DROPITEM_PHASE1),true); + $stage = (($x[0]['item_hidden']) ? DROPITEM_NORMAL : DROPITEM_PHASE1); + $interactive = (($x[0]['item_hidden']) ? false : true); + drop_item($x[0]['id'], $interactive, $stage); } $r = q("SELECT content FROM photo WHERE resource_id = '%s' AND uid = %d AND os_storage = 1", |