X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fgroup.php;h=e16c900d90cc27257c67acf22b1b85bc52bb619b;hb=24836f2966842b413ae29f325fbb61b30186a5f7;hp=065c2241febec2bb286f5ba2086ad1c57a60049f;hpb=f04e2e70447e433bdc6acb2094fd988a995d1c08;p=friendica.git diff --git a/include/group.php b/include/group.php index 065c2241fe..e16c900d90 100644 --- a/include/group.php +++ b/include/group.php @@ -123,7 +123,8 @@ function group_public_members($gid) { 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' ", + 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()) ); @@ -135,7 +136,7 @@ function group_public_members($gid) { -function group_side($every="contacts",$each="group",$edit = false) { +function group_side($every="contacts",$each="group",$edit = false, $group_id = 0) { $o = ''; @@ -144,30 +145,37 @@ function group_side($every="contacts",$each="group",$edit = false) { $createtext = t('Create a new group'); $linktext= t('Everybody'); - + $selected = (($group_id == 0) ? ' class="group-selected" ' : ''); $o .= <<< EOT
"; + $o .= " \r\n "; + + $o .= <<< EOT + + + + +EOT; return $o; } @@ -184,3 +192,15 @@ function expand_groups($a) { $ret[] = $rr['contact-id']; return $ret; } + + +function member_of($c) { + + $r = q("SELECT `group`.`name`, `group`.`id` FROM `group` LEFT JOIN `group_member` ON `group_member`.`gid` = `group`.`id` WHERE `group_member`.`contact-id` = %d AND `group`.`deleted` = 0 ORDER BY `group`.`name` ASC ", + intval($c) + ); + + return $r; + +} +