X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fgroup.php;h=07cd45f199d32f2f33a23cdf8ec8c4d465ac4d42;hb=b8479cc2f98bdd3b144cfda127c799ba4740fc83;hp=bca369cd1aaaab9c4aa116256e4362009499f283;hpb=52a2c7eb46ea3b9509e48f29eca6f1c398a85538;p=friendica.git diff --git a/include/group.php b/include/group.php index bca369cd1a..07cd45f199 100644 --- a/include/group.php +++ b/include/group.php @@ -38,7 +38,7 @@ function group_rmv($uid,$name) { ); // remove group - $r = q("DELETE FROM `group` WHERE `uid` = %d AND `id` = %d LIMIT 1", + $r = q("UPDATE `group` SET `deleted` = 1 WHERE `uid` = %d AND `name` = '%s' LIMIT 1", intval($uid), dbesc($name) ); @@ -46,7 +46,6 @@ function group_rmv($uid,$name) { $ret = $r; } - // TODO!! remove this group from all content ACL's !! return $ret; } @@ -111,7 +110,7 @@ function group_get_members($gid) { LEFT JOIN `contact` ON `contact`.`id` = `group_member`.`contact-id` WHERE `gid` = %d AND `group_member`.`uid` = %d", intval($gid), - intval($_SESSION['uid']) + intval(local_user()) ); if(count($r)) $ret = $r; @@ -119,28 +118,49 @@ function group_get_members($gid) { return $ret; } +function group_public_members($gid) { + $ret = 0; + if(intval($gid)) { + $r = q("SELECT `contact`.`id` AS `contact-id` FROM `group_member` + LEFT JOIN `contact` ON `contact`.`id` = `group_member`.`contact-id` + WHERE `gid` = %d AND `group_member`.`uid` = %d AND `contact`.`network` != 'dfrn' ", + intval($gid), + intval(local_user()) + ); + if(count($r)) + $ret = count($r); + } + return $ret; +} + function group_side($every="contacts",$each="group") { + $o = ''; + if(! local_user()) - return; + return ''; + + $createtext = t('Create a new group'); + $linktext= t('Everybody'); + $o .= <<< EOT

Groups