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
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');
}
'label_members' => t('Members'),
'members' => array(),
'label_contacts' => t('All Contacts'),
+ 'group_is_empty' => t('Group is empty'),
'contacts' => array(),
);
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)) {