]> git.mxchange.org Git - friendica.git/blobdiff - include/socgraph.php
prevent duplicate @ tags
[friendica.git] / include / socgraph.php
index c81c7b695229ae60dd7ccb9f786128e992a7658e..b9f53d6a6d0c0862d49814547d1f7d998363fdc4 100644 (file)
@@ -159,4 +159,25 @@ function common_friends($uid,$cid) {
 
        return $r;
 
-}
\ No newline at end of file
+}
+
+
+
+function suggestion_query($uid, $start = 0, $limit = 40) {
+
+       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)
+               group by glink.gcid order by total desc limit %d, %d ",
+               intval($uid),
+               intval($uid),
+               intval($start),
+               intval($limit)
+       );
+
+       return $r;
+
+}