4 function lockview_content(App &$a) {
6 $type = (($a->argc > 1) ? $a->argv[1] : 0);
7 if (is_numeric($type)) {
8 $item_id = intval($type);
11 $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
17 if (!in_array($type, array('item','photo','event')))
20 $r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1",
24 if (! dbm::is_result($r)) {
29 call_hooks('lockview_content', $item);
31 if($item['uid'] != local_user()) {
32 echo t('Remote privacy information not available.') . '<br />';
37 if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
38 && (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
40 echo t('Remote privacy information not available.') . '<br />';
44 $allowed_users = expand_acl($item['allow_cid']);
45 $allowed_groups = expand_acl($item['allow_gid']);
46 $deny_users = expand_acl($item['deny_cid']);
47 $deny_groups = expand_acl($item['deny_gid']);
49 $o = t('Visible to:') . '<br />';
52 if(count($allowed_groups)) {
53 $r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
54 dbesc(implode(', ', $allowed_groups))
56 if (dbm::is_result($r))
58 $l[] = '<b>' . $rr['name'] . '</b>';
60 if(count($allowed_users)) {
61 $r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
62 dbesc(implode(', ',$allowed_users))
64 if (dbm::is_result($r))
70 if(count($deny_groups)) {
71 $r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
72 dbesc(implode(', ', $deny_groups))
74 if (dbm::is_result($r))
76 $l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
78 if(count($deny_users)) {
79 $r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
80 dbesc(implode(', ',$deny_users))
82 if (dbm::is_result($r))
84 $l[] = '<strike>' . $rr['name'] . '</strike>';
88 echo $o . implode(', ', $l);