diff options
author | friendica <info@friendica.com> | 2012-05-17 22:44:52 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-05-17 22:44:52 -0700 |
commit | 7b0ded3f1478553e1fe93c95c272b99d78f0132b (patch) | |
tree | 2afc3fccae7d3f698ad89dc7c77386ac93890080 /include/group.php | |
parent | 7cfa7a7671f0bf8316bc63912452e156fc48129e (diff) | |
download | volse-hubzilla-7b0ded3f1478553e1fe93c95c272b99d78f0132b.tar.gz volse-hubzilla-7b0ded3f1478553e1fe93c95c272b99d78f0132b.tar.bz2 volse-hubzilla-7b0ded3f1478553e1fe93c95c272b99d78f0132b.zip |
more private forums, default privacy group for new contacts
Diffstat (limited to 'include/group.php')
-rw-r--r-- | include/group.php | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/include/group.php b/include/group.php index edb547de6..cc6540b31 100644 --- a/include/group.php +++ b/include/group.php @@ -97,8 +97,9 @@ function group_rmv_member($uid,$name,$member) { } -function group_add_member($uid,$name,$member) { - $gid = group_byname($uid,$name); +function group_add_member($uid,$name,$member,$gid = 0) { + if(! $gid) + $gid = group_byname($uid,$name); if((! $gid) || (! $uid) || (! $member)) return false; @@ -154,6 +155,29 @@ function group_public_members($gid) { } +function mini_group_select($uid,$gid = 0) { + + $grps = array(); + $o = ''; + + $r = q("SELECT * FROM `group` WHERE `deleted` = 0 AND `uid` = %d ORDER BY `name` ASC", + intval($uid) + ); + $grps[] = array('name' => '', 'id' => '0', 'selected' => ''); + if(count($r)) { + foreach($r as $rr) { + $grps[] = array('name' => $rr['name'], 'id' => $rr['id'], 'selected' => (($gid == $rr['id']) ? 'true' : '')); + } + + } + logger('groups: ' . print_r($grps,true)); + + $o = replace_macros(get_markup_template('group_selection.tpl'), array('$groups' => $grps )); + return $o; +} + + + function group_side($every="contacts",$each="group",$edit = false, $group_id = 0, $cid = 0) { |