aboutsummaryrefslogtreecommitdiffstats
path: root/include/group.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/group.php')
-rw-r--r--include/group.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/group.php b/include/group.php
index 1f48cdd56..f2e3d1820 100644
--- a/include/group.php
+++ b/include/group.php
@@ -150,4 +150,17 @@ EOT;
$o .= " </ul>\r\n </div>\r\n</div>";
return $o;
-} \ No newline at end of file
+}
+
+function expand_groups($a) {
+ if(! (is_array($a) && count($a)))
+ return array();
+ $groups = implode(',', $a);
+ $groups = dbesc($groups);
+ $r = q("SELECT `contact-id` FROM `group_member` WHERE `gid` IN ( $groups )");
+ $ret = array();
+ if(count($r))
+ foreach($r as $rr)
+ $ret[] = $rr['contact-id'];
+ return $ret;
+}