]> git.mxchange.org Git - friendica.git/blobdiff - include/socgraph.php
Several improvements
[friendica.git] / include / socgraph.php
index b2f5455094e53621c9a4a414c0702ecc639b47f1..3f519404928134a5bf65ed9248974a4e0d8298c7 100755 (executable)
@@ -237,12 +237,14 @@ function suggestion_query($uid, $start = 0, $limit = 80) {
 
        $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)
        );
@@ -252,11 +254,13 @@ function suggestion_query($uid, $start = 0, $limit = 80) {
 
        $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)
        );