X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fgroup.php;h=8866104fca54a58ad49bfded919bb220e6633158;hb=19ccd658ebcf13a7cc208a3e460e44d152dda32f;hp=799065e27dd34e5e780fa47eff07c4ae46f44169;hpb=d2c6fa3fa15177990dbc1ae6370f670ed59b3243;p=friendica.git diff --git a/include/group.php b/include/group.php index 799065e27d..8866104fca 100644 --- a/include/group.php +++ b/include/group.php @@ -108,9 +108,9 @@ function group_get_members($gid) { 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", + WHERE `gid` = %d AND `group_member`.`uid` = %d ORDER BY `contact`.`name` ASC ", intval($gid), - intval($_SESSION['uid']) + intval(local_user()) ); if(count($r)) $ret = $r; @@ -118,15 +118,33 @@ 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' AND `contact`.`network` != 'mail' AND `contact`.`network` != 'face' ", + intval($gid), + intval(local_user()) + ); + if(count($r)) + $ret = count($r); + } + return $ret; +} + + +function group_side($every="contacts",$each="group",$edit = false) { -function group_side($every="contacts",$each="group") { + $o = ''; if(! local_user()) - return; + return ''; -$createtext = t('Create a new group'); -$linktext= t('Everybody'); + $createtext = t('Create a new group'); + $linktext= t('Everybody'); $o .= <<< EOT @@ -148,7 +166,7 @@ EOT; ); if(count($r)) { foreach($r as $rr) - $o .= "
  • {$rr['name']}
  • \r\n"; + $o .= ' \r\n"; } $o .= " \r\n \r\n";