4 function lockview_content(&$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",
28 call_hooks('lockview_content', $item);
30 if($item['uid'] != local_user()) {
31 echo t('Remote privacy information not available.') . '<br />';
36 if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
37 && (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
39 echo t('Remote privacy information not available.') . '<br />';
43 $allowed_users = expand_acl($item['allow_cid']);
44 $allowed_groups = expand_acl($item['allow_gid']);
45 $deny_users = expand_acl($item['deny_cid']);
46 $deny_groups = expand_acl($item['deny_gid']);
48 $o = t('Visible to:') . '<br />';
51 if(count($allowed_groups)) {
52 $r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
53 dbesc(implode(', ', $allowed_groups))
57 $l[] = '<b>' . $rr['name'] . '</b>';
59 if(count($allowed_users)) {
60 $r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
61 dbesc(implode(', ',$allowed_users))
69 if(count($deny_groups)) {
70 $r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
71 dbesc(implode(', ', $deny_groups))
75 $l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
77 if(count($deny_users)) {
78 $r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
79 dbesc(implode(', ',$deny_users))
83 $l[] = '<strike>' . $rr['name'] . '</strike>';
87 echo $o . implode(', ', $l);