From 158028a0ac00e388347ac366c88ad07c0fe4bfb9 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 1 Nov 2011 20:29:55 -0700 Subject: first cut friend suggestions --- include/socgraph.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'include/socgraph.php') diff --git a/include/socgraph.php b/include/socgraph.php index c81c7b695..04e9a9a64 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -159,4 +159,22 @@ function common_friends($uid,$cid) { return $r; -} \ No newline at end of file +} + + + +function suggestion_query($uid, $start = 0, $limit = 40) { + + $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; + +} -- cgit v1.2.3