diff options
Diffstat (limited to 'include/group.php')
-rw-r--r-- | include/group.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/group.php b/include/group.php index 585b2eab9..1f48cdd56 100644 --- a/include/group.php +++ b/include/group.php @@ -2,7 +2,7 @@ function group_add($uid,$name) { -dbg(2); + $ret = false; if(x($uid) && x($name)) { $r = group_byname($uid,$name); // check for dups @@ -104,6 +104,21 @@ function group_add_member($uid,$name,$member) { return $r; } +function group_get_members($gid) { + $ret = array(); + if(intval($gid)) { + $r = q("SELECT `group_member`.`contact-id`, `contact`.* FROM `group_member` + LEFT JOIN `contact` ON `contact`.`id` = `group_member`.`contact-id` + WHERE `gid` = %d AND `group_member`.`uid` = %d", + intval($gid), + intval($_SESSION['uid']) + ); + if(count($r)) + $ret = $r; + } + return $ret; +} + function group_side() { |