aboutsummaryrefslogtreecommitdiffstats
path: root/mod/display.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/display.php')
-rw-r--r--mod/display.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/mod/display.php b/mod/display.php
index 8c4707bb2..b2d9ba34b 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -85,7 +85,7 @@ function display_content(&$a, $update = 0, $load = false) {
$target_item = null;
- $r = q("select id, uid, mid, parent_mid, item_restrict from item where mid like '%s' limit 1",
+ $r = q("select id, uid, mid, parent_mid, item_type, item_deleted from item where mid like '%s' limit 1",
dbesc($item_hash . '%')
);
@@ -95,7 +95,7 @@ function display_content(&$a, $update = 0, $load = false) {
$r = null;
- if($target_item['item_restrict'] & ITEM_WEBPAGE) {
+ if($target_item['item_type'] == ITEM_TYPE_WEBPAGE) {
$x = q("select * from channel where channel_id = %d limit 1",
intval($target_item['uid'])
);
@@ -161,6 +161,7 @@ function display_content(&$a, $update = 0, $load = false) {
}
$observer_hash = get_observer_hash();
+ $item_normal = item_normal();
$sql_extra = public_permissions_sql($observer_hash);
@@ -179,9 +180,9 @@ function display_content(&$a, $update = 0, $load = false) {
if(local_channel()) {
$r = q("SELECT * from item
- WHERE item_restrict = 0
- and uid = %d
+ WHERE uid = %d
and mid = '%s'
+ $item_normal
limit 1",
intval(local_channel()),
dbesc($target_item['parent_mid'])
@@ -202,13 +203,13 @@ function display_content(&$a, $update = 0, $load = false) {
$r = q("SELECT * from item
- WHERE item_restrict = 0
- and mid = '%s'
+ WHERE mid = '%s'
AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = ''
AND `item`.`deny_gid` = '' AND item_private = 0 )
and owner_xchan in ( " . stream_perms_xchans(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
OR uid = %d )
$sql_extra )
+ $item_normal
limit 1",
dbesc($target_item['parent_mid']),
intval($sysid)
@@ -228,7 +229,7 @@ function display_content(&$a, $update = 0, $load = false) {
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`
FROM `item`
- WHERE item_restrict = 0 and parent in ( %s ) ",
+ WHERE parent in ( %s ) $item_normal ",
dbesc($parents_str)
);
@@ -251,7 +252,7 @@ function display_content(&$a, $update = 0, $load = false) {
}
if($updateable) {
- $x = q("UPDATE item SET item_unseen = 0 WHERE item_unseen = 1 AND uid = %d and parent = %d ",
+ $x = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 AND uid = %d and parent = %d ",
intval(local_channel()),
intval($r[0]['parent'])
);
@@ -270,7 +271,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 {