function group_get_members($gid) {
$ret = array();
if(intval($gid)) {
- $r = q("SELECT `group_member`.`contact-id`, `contact`.* FROM `group_member`
- INNER JOIN `contact` ON `contact`.`id` = `group_member`.`contact-id`
- WHERE `gid` = %d AND `group_member`.`uid` = %d ORDER BY `contact`.`name` ASC ",
+ $r = q("SELECT `group_member`.`contact-id`, `contact`.* FROM `group_member`
+ INNER JOIN `contact` ON `contact`.`id` = `group_member`.`contact-id`
+ WHERE `gid` = %d AND `group_member`.`uid` = %d AND
+ NOT `contact`.`self` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
+ ORDER BY `contact`.`name` ASC ",
intval($gid),
intval(local_user())
);
function group_public_members($gid) {
$ret = 0;
if(intval($gid)) {
- $r = q("SELECT `contact`.`id` AS `contact-id` FROM `group_member`
- INNER JOIN `contact` ON `contact`.`id` = `group_member`.`contact-id`
- WHERE `gid` = %d AND `group_member`.`uid` = %d
+ $r = q("SELECT `contact`.`id` AS `contact-id` FROM `group_member`
+ INNER JOIN `contact` ON `contact`.`id` = `group_member`.`contact-id`
+ WHERE `gid` = %d AND `group_member`.`uid` = %d
AND `contact`.`network` = '%s' AND `contact`.`notify` != '' ",
intval($gid),
intval(local_user()),
dbesc(NETWORK_OSTATUS)
- );
+ );
if(count($r))
$ret = count($r);
}
function mini_group_select($uid,$gid = 0) {
-
+
$grps = array();
$o = '';
$o = replace_macros(get_markup_template('group_selection.tpl'), array(
'$label' => t('Default privacy group for new contacts'),
- '$groups' => $grps
+ '$groups' => $grps
));
return $o;
}
$a->page['aside'] = group_side();
}
- return;
+ return;
}
function group_content(&$a) {
$change = false;
-
+
if(! local_user()) {
notice( t('Permission denied') . EOL);
return;
'$form_security_token' => get_form_security_token("group_drop"),
));
-
+
$context = $context + array(
'$title' => t('Group Editor'),
'$gname' => array('groupname',t('Group Name: '),$group['name'], ''),
'label_contacts' => t('All Contacts'),
'contacts' => array(),
);
-
+
$sec_token = addslashes(get_form_security_token('group_member_change'));
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false);
foreach($members as $member) {
echo replace_macros($tpl, $context);
killme();
}
-
+
return replace_macros($tpl, $context);
}
-