aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-11-08 18:30:20 -0800
committerFriendika <info@friendika.com>2011-11-08 18:30:20 -0800
commit05cabf24a9ad370d9742725271d165cf80509227 (patch)
tree94f1934782cc3d3c88d66f8f9810b51eb9c2d16f /include
parent20ca93191fda9f25f387e354a8ac4edd9582ded5 (diff)
downloadvolse-hubzilla-05cabf24a9ad370d9742725271d165cf80509227.tar.gz
volse-hubzilla-05cabf24a9ad370d9742725271d165cf80509227.tar.bz2
volse-hubzilla-05cabf24a9ad370d9742725271d165cf80509227.zip
first checkin - updated contact_edit, more work remains
Diffstat (limited to 'include')
-rw-r--r--include/socgraph.php30
1 files changed, 30 insertions, 0 deletions
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) {