X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdirfind.php;h=7d167494e6b6f7d1dd2f5729142cc846ca84adf2;hb=2894214347953f0d8f288ae1999688f2396d67a5;hp=0e5f8a90d1b3bebe020b3f61375aca00b05655d1;hpb=09851331a9dc8601919cd0c9200686b92843d235;p=friendica.git diff --git a/mod/dirfind.php b/mod/dirfind.php index 0e5f8a90d1..7d167494e6 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -1,9 +1,14 @@ page['aside'] .= follow_widget(); } - - function dirfind_content(App $a, $prefix = "") { $community = false; @@ -35,7 +38,7 @@ function dirfind_content(App $a, $prefix = "") { if (strpos($search,'@') === 0) { $search = substr($search,1); $header = sprintf( t('People Search - %s'), $search); - if ((valid_email($search) AND validate_email($search)) OR + if ((valid_email($search) && validate_email($search)) || (substr(normalise_link($search), 0, 7) == "http://")) { $user_data = probe_url($search); $discover_user = (in_array($user_data["network"], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA))); @@ -73,9 +76,9 @@ function dirfind_content(App $a, $prefix = "") { $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); + if (($contact["cid"] == 0) && ($contact["zid"] == 0) && ($contact["gid"] == 0)) { + update_gcontact($user_data); + } } elseif ($local) { if ($community) @@ -166,9 +169,8 @@ function dirfind_content(App $a, $prefix = "") { $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : ''); - if (strlen(get_config('system','directory'))) { + if(strlen(get_config('system','directory'))) $x = fetch_url(get_server().'/lsearch?f=' . $p . '&search=' . urlencode($search)); - } $j = json_decode($x); } @@ -204,7 +206,7 @@ function dirfind_content(App $a, $prefix = "") { $photo_menu = array(); } } else { - $connlnk = App::get_baseurl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url); + $connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url); $conntxt = t('Connect'); $photo_menu = array( 'profile' => array(t("View Profile"), zrl($jj->url)),