X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fsocgraph.php;h=b9f53d6a6d0c0862d49814547d1f7d998363fdc4;hb=a9ec56ace1756726517650d96192df5320f445fe;hp=c81c7b695229ae60dd7ccb9f786128e992a7658e;hpb=3d9a9614e232a3ff207803be1092b1d42bcadde6;p=friendica.git diff --git a/include/socgraph.php b/include/socgraph.php index c81c7b6952..b9f53d6a6d 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -159,4 +159,25 @@ function common_friends($uid,$cid) { return $r; -} \ No newline at end of file +} + + + +function suggestion_query($uid, $start = 0, $limit = 40) { + + if(! $uid) + return array(); + + $r = q("SELECT count(glink.gcid) as `total`, gcontact.* from gcontact + left join glink on glink.gcid = gcontact.id + where uid = %d and not gcontact.nurl in ( select nurl from contact where uid = %d) + group by glink.gcid order by total desc limit %d, %d ", + intval($uid), + intval($uid), + intval($start), + intval($limit) + ); + + return $r; + +}