function group_init(&$a) {
if(local_user()) {
require_once('include/group.php');
- $a->page['aside'] = group_side('contacts','group',false,(($a->argc > 1) ? intval($a->argv[1]) : 0));
+ $a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0));
}
}
intval($a->argv[1]),
intval(local_user())
);
- if(! count($r)) {
+ if(! dbm::is_result($r)) {
notice( t('Group not found.') . EOL );
goaway($a->get_baseurl() . '/contacts');
return; // NOTREACHED
$a->page['aside'] = group_side();
}
- return;
+ return;
}
function group_content(&$a) {
$change = false;
-
+
if(! local_user()) {
notice( t('Permission denied') . EOL);
return;
intval($a->argv[2]),
intval(local_user())
);
- if(count($r))
+ if (dbm::is_result($r))
$result = group_rmv(local_user(),$r[0]['name']);
if($result)
info( t('Group removed.') . EOL);
intval($a->argv[2]),
intval(local_user())
);
- if(count($r))
+ if (dbm::is_result($r))
$change = intval($a->argv[2]);
}
intval($a->argv[1]),
intval(local_user())
);
- if(! count($r)) {
+ if(! dbm::is_result($r)) {
notice( t('Group not found.') . EOL );
goaway($a->get_baseurl() . '/contacts');
}
'$form_security_token' => get_form_security_token("group_drop"),
));
- $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
-
$context = $context + array(
'$title' => t('Group Editor'),
'$gname' => array('groupname',t('Group Name: '),$group['name'], ''),
'label_members' => t('Members'),
'members' => array(),
'label_contacts' => t('All Contacts'),
+ 'group_is_empty' => t('Group is empty'),
'contacts' => array(),
);
-
+
$sec_token = addslashes(get_form_security_token('group_member_change'));
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false);
foreach($members as $member) {
group_rmv_member(local_user(),$group['name'],$member['id']);
}
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC",
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `self` ORDER BY `name` ASC",
intval(local_user())
);
- if(count($r)) {
+ if (dbm::is_result($r)) {
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
foreach($r as $member) {
if(! in_array($member['id'],$preselected)) {
echo replace_macros($tpl, $context);
killme();
}
-
+
return replace_macros($tpl, $context);
}
-