diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/acl.php | 5 | ||||
-rw-r--r-- | mod/photos.php | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/mod/acl.php b/mod/acl.php index 143b8098e..1b7a1ea8b 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -77,9 +77,8 @@ function acl_init(&$a){ // autocomplete for Contacts - $r = q("SELECT COUNT(`id`) AS c FROM `contact` - WHERE `uid` = %d AND `self` = 0 - AND `pending` = 0 $sql_extra2" , + $r = q("SELECT COUNT(abook_id) AS c FROM abook left join xchan on abook_xchan = xchan_hash + WHERE abook_channel = %d $sql_extra2" , intval(local_user()) ); $contact_count = (int)$r[0]['c']; diff --git a/mod/photos.php b/mod/photos.php index 789e26949..5573f6a87 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -184,12 +184,13 @@ function photos_post(&$a) { intval($page_owner_uid), dbesc($r[0]['resource_id']) ); - $i = q("SELECT * FROM `item` WHERE `resource_id` = '%s' AND `uid` = %d LIMIT 1", + $i = q("SELECT * FROM `item` WHERE `resource_id` = '%s' AND resource_type = 'photo' and `uid` = %d LIMIT 1", dbesc($r[0]['resource_id']), intval($page_owner_uid) ); if(count($i)) { - q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent_mid` = '%s' AND `uid` = %d", + q("UPDATE `item` SET item_restrict = (item_restrict & %d), `edited` = '%s', `changed` = '%s' WHERE `parent_mid` = '%s' AND `uid` = %d", + intval(ITEM_DELETED), dbesc(datetime_convert()), dbesc(datetime_convert()), dbesc($i[0]['mid']), |