]> git.mxchange.org Git - friendica.git/blobdiff - include/group.php
Merge branch 'opensearch' of https://github.com/fabrixxm/friendika into fabrixxm...
[friendica.git] / include / group.php
index 793e854be046bc7f43db7572b249621e2dc19e8d..07cd45f199d32f2f33a23cdf8ec8c4d465ac4d42 100644 (file)
@@ -110,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;
@@ -118,6 +118,21 @@ 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") {