Revert "include/socgraph - remove a few obsolete and long-deprecated functions"
This reverts commit e2d028fb97
.
This commit is contained in:
parent
e2d028fb97
commit
f3061651d4
@ -243,6 +243,77 @@ function common_friends($uid,$xchan,$start = 0,$limit=100000000,$shuffle = false
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function count_common_friends_zcid($uid,$zcid) {
|
||||||
|
|
||||||
|
$r = q("SELECT count(*) as total
|
||||||
|
FROM glink left join gcontact on glink.gcid = gcontact.id
|
||||||
|
where glink.zcid = %d
|
||||||
|
and gcontact.nurl in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 ) ",
|
||||||
|
intval($zcid),
|
||||||
|
intval($uid)
|
||||||
|
);
|
||||||
|
|
||||||
|
if(count($r))
|
||||||
|
return $r[0]['total'];
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function common_friends_zcid($uid,$zcid,$start = 0, $limit = 9999,$shuffle = false) {
|
||||||
|
|
||||||
|
if($shuffle)
|
||||||
|
$sql_extra = " order by rand() ";
|
||||||
|
else
|
||||||
|
$sql_extra = " order by gcontact.name asc ";
|
||||||
|
|
||||||
|
$r = q("SELECT gcontact.*
|
||||||
|
FROM glink left join gcontact on glink.gcid = gcontact.id
|
||||||
|
where glink.zcid = %d
|
||||||
|
and gcontact.nurl in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 )
|
||||||
|
$sql_extra limit %d offset %d",
|
||||||
|
intval($zcid),
|
||||||
|
intval($uid),
|
||||||
|
intval($limit),
|
||||||
|
intval($start)
|
||||||
|
);
|
||||||
|
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
order by gcontact.name asc LIMIT %d OFFSET %d ",
|
||||||
|
intval($cid),
|
||||||
|
intval($uid),
|
||||||
|
intval($limit),
|
||||||
|
intval($start)
|
||||||
|
);
|
||||||
|
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) {
|
function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) {
|
||||||
|
|
||||||
if((! $uid) || (! $myxchan))
|
if((! $uid) || (! $myxchan))
|
||||||
|
Reference in New Issue
Block a user