+ if($system_mode) {
+ $r = q("SELECT * from contact where self = 1
+ and uid in (select uid from pconfig where cat = 'system' and k = 'suggestme' and v = 1) limit %d, %d ",
+ intval($startIndex),
+ intval($itemsPerPage)
+ );
+ }
+ else {
+
+ $r = q("SELECT * from `contact` where `uid` = %d and blocked = 0 and pending = 0 and hidden = 0
+ $sql_extra LIMIT %d, %d",
+ intval($user['uid']),
+ intval($startIndex),
+ intval($itemsPerPage)
+ );
+ }