1
0
Fork 0

bug #369 - show contacts who are not in any groups

This commit is contained in:
friendica 2012-04-12 23:06:41 -07:00
commit 3c4e6d3461
5 changed files with 102 additions and 5 deletions

View file

@ -176,12 +176,26 @@ function random_profile() {
}
function contacts_not_grouped($uid) {
$r = q("select * from contact where uid = %d and self = 0 and id not in (select distinct(`contact-id`) from group_member where uid = %d) ",
intval($uid),
intval($uid)
);
function contacts_not_grouped($uid,$start = 0,$count = 0) {
dbg(1);
if(! $count) {
$r = q("select count(*) as total from contact where uid = %d and self = 0 and id not in (select distinct(`contact-id`) from group_member where uid = %d) ",
intval($uid),
intval($uid)
);
dbg(0);
return $r;
}
dbg(1);
$r = q("select * from contact where uid = %d and self = 0 and id not in (select distinct(`contact-id`) from group_member where uid = %d) limit %d, %d",
intval($uid),
intval($uid),
intval($start),
intval($count)
);
dbg(0);
return $r;
}

View file

@ -212,6 +212,7 @@ function group_side($every="contacts",$each="group",$edit = false, $group_id = 0
'$title' => t('Groups'),
'$edittext' => t('Edit group'),
'$createtext' => t('Create a new group'),
'$ungrouped' => (($every === 'contacts') ? t('Contacts not in any group') : ''),
'$groups' => $groups,
'$add' => t('add'),
));