+ if ($discover_user) {
+ $j = new stdClass();
+ $j->total = 1;
+ $j->items_page = 1;
+ $j->page = $a->pager['page'];
+
+ $objresult = new stdClass();
+ $objresult->cid = 0;
+ $objresult->name = $user_data["name"];
+ $objresult->addr = $user_data["addr"];
+ $objresult->url = $user_data["url"];
+ $objresult->photo = $user_data["photo"];
+ $objresult->tags = "";
+ $objresult->network = $user_data["network"];
+
+ $contact = get_contact_details_by_url($user_data["url"], local_user());
+ $objresult->cid = $contact["cid"];
+
+ $j->results[] = $objresult;
+
+ // Add the contact to the global contacts if it isn't already in our system
+ if (($contact["cid"] == 0) AND ($contact["zid"] == 0) AND ($contact["gid"] == 0))
+ poco_check($user_data["url"], $user_data["name"], $user_data["network"], $user_data["photo"],
+ "", "", "", "", "", datetime_convert(), 0);
+ } elseif ($local) {