X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fgroup.php;h=07cd45f199d32f2f33a23cdf8ec8c4d465ac4d42;hb=b8479cc2f98bdd3b144cfda127c799ba4740fc83;hp=f2e3d18203b570266cc70edaaba32f7350d65942;hpb=d20e1a6f938d088708166e039ae0088a8ddf11e4;p=friendica.git diff --git a/include/group.php b/include/group.php index f2e3d18203..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,33 +118,54 @@ 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") { -function group_side() { + $o = ''; if(! local_user()) - return; + return ''; + + $createtext = t('Create a new group'); + $linktext= t('Everybody'); + $o .= <<< EOT
";