X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fsocgraph.php;h=3f519404928134a5bf65ed9248974a4e0d8298c7;hb=aace55df0ad279d74c5e612078c3f29d114389dc;hp=60bf075d3e8a0dcc34827bc95dc1aaa5f5775a62;hpb=2a3f94e4521f00142b99ba4fa5f4ec093159cbb7;p=friendica.git diff --git a/include/socgraph.php b/include/socgraph.php old mode 100644 new mode 100755 index 60bf075d3e..3f51940492 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -58,6 +58,9 @@ function poco_load($cid,$uid = 0,$url = null) { logger('poco_load: json: ' . print_r($j,true),LOGGER_DATA); + if(! isset($j->entry)) + return; + $total = 0; foreach($j->entry as $entry) { @@ -227,19 +230,21 @@ function all_friends($uid,$cid,$start = 0, $limit = 80) { -function suggestion_query($uid, $start = 0, $limit = 40) { +function suggestion_query($uid, $start = 0, $limit = 80) { 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) + where uid = %d and not gcontact.nurl in ( select nurl from contact where uid = %d ) + and not gcontact.name in ( select name from contact where uid = %d ) and not gcontact.id in ( select gcid from gcign where uid = %d ) group by glink.gcid order by total desc limit %d, %d ", intval($uid), intval($uid), intval($uid), + intval($uid), intval($start), intval($limit) ); @@ -249,11 +254,13 @@ function suggestion_query($uid, $start = 0, $limit = 40) { $r2 = q("SELECT gcontact.* from gcontact left join glink on glink.gcid = gcontact.id - where glink.uid = 0 and glink.cid = 0 and not gcontact.nurl in ( select nurl from contact where uid = %d) + where glink.uid = 0 and glink.cid = 0 and not gcontact.nurl in ( select nurl from contact where uid = %d ) + and not gcontact.name in ( select name from contact where uid = %d ) and not gcontact.id in ( select gcid from gcign where uid = %d ) order by rand() limit %d, %d ", intval($uid), intval($uid), + intval($uid), intval($start), intval($limit) );