diff --git a/include/group.php b/include/group.php index d1b336946..804d0c58f 100644 --- a/include/group.php +++ b/include/group.php @@ -185,3 +185,15 @@ function expand_groups($a) { $ret[] = $rr['contact-id']; return $ret; } + + +function member_of($c) { + + $r = q("SELECT `group`.`name`, `group`.`id` FROM `group` LEFT JOIN `group_member` ON `group_member`.`gid` = `group`.`id` WHERE `group_member`.`contact-id` = %d AND `group`.`deleted` = 0 ORDER BY `group`.`name` ASC ", + intval($c) + ); + + return $r; + +} + diff --git a/mod/contacts.php b/mod/contacts.php index 4baa2d2d7..e7a800500 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -249,6 +249,15 @@ function contacts_content(&$a) { $sparkle = ''; } + $grps = ''; + $member_of = member_of($r[0]['id']); + if(is_array($member_of) && count($member_of)) { + $grps = t('Member of: ') . EOL . '
' . t('Private communications are not available for this contact.') . '