diff options
Diffstat (limited to 'include/Contact.php')
-rw-r--r-- | include/Contact.php | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/include/Contact.php b/include/Contact.php index ee434cb6d..388819b01 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -173,4 +173,29 @@ function random_profile() { if(count($r)) return dirname($r[0]['url']); return ''; -}
\ No newline at end of file +} + + +function contacts_not_grouped($uid,$start = 0,$count = 0) { + + 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) + ); + + return $r; + + + } + + $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) and blocked = 0 and pending = 0 limit %d, %d", + intval($uid), + intval($uid), + intval($start), + intval($count) + ); + + return $r; +} + |