diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-05-18 12:12:40 -0400 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-05-18 12:12:40 -0400 |
commit | 83f0807e59b5be288374a825d1e4f75869d515de (patch) | |
tree | 8f3226d74c76d736564e0c6ed9e97f6d0388126c /include/group.php | |
parent | c024c17b5f7253432e9c53aa642f003b537f6b6b (diff) | |
parent | 38217444502aee41d71d90c0c8927999bb1b12e6 (diff) | |
download | volse-hubzilla-83f0807e59b5be288374a825d1e4f75869d515de.tar.gz volse-hubzilla-83f0807e59b5be288374a825d1e4f75869d515de.tar.bz2 volse-hubzilla-83f0807e59b5be288374a825d1e4f75869d515de.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
apply max-width to images in posts, duepuntozero
theming for default group selector
catch more places to apply default group
make it difficult to setup a private forum with no privacy
more private forums, default privacy group for new contacts
tell browser not to cache permission denied (private) photos so that after authenticating we don't have to fight the browser - plus more prvgroup work
* master:
Diffstat (limited to 'include/group.php')
-rw-r--r-- | include/group.php | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/include/group.php b/include/group.php index edb547de6..854ac06a9 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,32 @@ 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( + '$label' => t('Default privacy group for new contacts'), + '$groups' => $grps + )); + return $o; +} + + + function group_side($every="contacts",$each="group",$edit = false, $group_id = 0, $cid = 0) { |