From 05cabf24a9ad370d9742725271d165cf80509227 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 8 Nov 2011 18:30:20 -0800 Subject: first checkin - updated contact_edit, more work remains --- include/socgraph.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'include/socgraph.php') diff --git a/include/socgraph.php b/include/socgraph.php index 84cfe4468..7f3ad7322 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -161,6 +161,36 @@ function common_friends($uid,$cid) { } +function count_all_friends($uid,$cid) { + + $r = q("SELECT count(*) as `total` + FROM `glink` left join `gcontact` on `glink`.`gcid` = `gcontact`.`id` + where `glink`.`cid` = %d and `glink`.`uid` = %d ", + intval($cid), + intval($uid) + ); + + if(count($r)) + return $r[0]['total']; + return 0; + +} + + +function all_friends($uid,$cid,$start = 0, $limit = 80) { + + $r = q("SELECT `gcontact`.* + FROM `glink` left join `gcontact` on `glink`.`gcid` = `gcontact`.`id` + where `glink`.`cid` = %d and `glink`.`uid` = %d LIMIT %d, %d ", + intval($cid), + intval($uid), + intval($start), + intval($limit) + ); + + return $r; +} + function suggestion_query($uid, $start = 0, $limit = 40) { -- cgit v1.2.3