From 4c2a1e572a03e253f05f03e400af26d403cbda32 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 22 Jan 2015 21:04:54 -0800 Subject: start on item_restrict conversion --- mod/display.php | 2 +- mod/item.php | 7 +++---- mod/photos.php | 13 +------------ 3 files changed, 5 insertions(+), 17 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index b9b660fdd..740050e41 100644 --- a/mod/display.php +++ b/mod/display.php @@ -250,7 +250,7 @@ function display_content(&$a, $update = 0, $load = false) { dbesc($item_hash) ); if($r) { - if($r[0]['item_flags'] & ITEM_DELETED) { + if(intval($r[0]['item_deleted'])) { notice( t('Item has been removed.') . EOL ); } else { diff --git a/mod/item.php b/mod/item.php index 26985dea4..294ee641f 100644 --- a/mod/item.php +++ b/mod/item.php @@ -1047,11 +1047,10 @@ function item_check_service_class($channel_id,$iswebpage) { if ($iswebpage) { $r = q("select count(i.id) as total from item i right join channel c on (i.author_xchan=c.channel_hash and i.uid=c.channel_id ) - and i.parent=i.id and (i.item_restrict & %d)>0 and not (i.item_restrict & %d)>0 and i.uid= %d ", + and i.parent=i.id and (i.item_restrict & %d)>0 and i.item_deleted = 0 and i.uid= %d ", intval(ITEM_WEBPAGE), - intval(ITEM_DELETED), - intval($channel_id) - ); + intval($channel_id) + ); } else { $r = q("select count(i.id) as total from item i diff --git a/mod/photos.php b/mod/photos.php index 216a562c7..5b86da2a1 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -180,19 +180,8 @@ function photos_post(&$a) { intval($page_owner_uid) ); if(count($i)) { - 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']), - intval($page_owner_uid) - ); - + drop_item($i[0]['id'],true,DROPITEM_PHASE1); $url = $a->get_baseurl(); - $drop_id = intval($i[0]['id']); - - if($i[0]['visible']) - proc_run('php',"include/notifier.php","drop","$drop_id"); } } -- cgit v1.2.3