From: friendica Date: Thu, 12 Apr 2012 14:48:28 +0000 (-0700) Subject: query to find un-grouped contacts X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=73487989c0a27deae38881379b052c5002b225ae;p=friendica.git query to find un-grouped contacts --- diff --git a/include/Contact.php b/include/Contact.php index ee434cb6db..8d893cf70e 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -173,4 +173,15 @@ function random_profile() { if(count($r)) return dirname($r[0]['url']); return ''; -} \ No newline at end of file +} + + +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) + ); + + return $r; +} +