4 function lockview_content(&$a) {
6 $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
10 $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
16 if($item['uid'] != local_user())
20 $allowed_users = expand_acl($item['allow_cid']);
21 $allowed_groups = expand_acl($item['allow_gid']);
22 $deny_users = expand_acl($item['deny_cid']);
23 $deny_groups = expand_acl($item['deny_gid']);
25 $o = t('Visible to:') . '<br />';
28 if(count($allowed_groups)) {
29 $r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
30 dbesc(implode(', ', $allowed_groups))
34 $l[] = '<b>' . $rr['name'] . '</b>';
36 if(count($allowed_users)) {
37 $r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
38 dbesc(implode(', ',$allowed_users))
46 if(count($deny_groups)) {
47 $r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
48 dbesc(implode(', ', $deny_groups))
52 $l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
54 if(count($deny_users)) {
55 $r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
56 dbesc(implode(', ',$deny_users))
60 $l[] = '<strike>' . $rr['name'] . '</strike>';
64 echo $o . implode(', ', $l);