X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdirfind.php;h=c5844d13dfa742689c0e202a7a9cd92a9772fd68;hb=f146c85e75314462823076a9d89ac2e698e6de45;hp=2b2badb64031f0780dacc95df7f9c17a264cf5b8;hpb=2178feab30c6bedbf1206b3e1f141a76301ab5fc;p=friendica.git diff --git a/mod/dirfind.php b/mod/dirfind.php index 2b2badb640..c5844d13df 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -5,7 +5,7 @@ require_once('include/Contact.php'); require_once('include/contact_selectors.php'); require_once('mod/contacts.php'); -function dirfind_init(App &$a) { +function dirfind_init(App $a) { if (! local_user()) { notice( t('Permission denied.') . EOL ); @@ -23,7 +23,7 @@ function dirfind_init(App &$a) { -function dirfind_content(&$a, $prefix = "") { +function dirfind_content(App $a, $prefix = "") { $community = false; $discover_user = false; @@ -73,9 +73,9 @@ function dirfind_content(&$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) AND ($contact["zid"] == 0) AND ($contact["gid"] == 0)) { + update_gcontact($user_data); + } } elseif ($local) { if ($community) @@ -88,20 +88,19 @@ function dirfind_content(&$a, $prefix = "") { if (get_config('system','diaspora_enabled')) { $diaspora = NETWORK_DIASPORA; - } - else { + } else { $diaspora = NETWORK_DFRN; } if (!get_config('system','ostatus_disabled')) { $ostatus = NETWORK_OSTATUS; - } - else { + } else { $ostatus = NETWORK_DFRN; } $search2 = "%".$search."%"; + /// @TODO These 2 SELECTs are not checked on validity with dbm::is_result() $count = q("SELECT count(*) AS `total` FROM `gcontact` LEFT JOIN `contact` ON `contact`.`nurl` = `gcontact`.`nurl` AND `contact`.`network` = `gcontact`.`network` @@ -200,8 +199,7 @@ function dirfind_content(&$a, $prefix = "") { $photo_menu = contact_photo_menu($contact[0]); $details = _contact_detail_for_template($contact[0]); $alt_text = $details['alt_text']; - } - else { + } else { $photo_menu = array(); } } else { @@ -243,8 +241,7 @@ function dirfind_content(&$a, $prefix = "") { '$paginate' => paginate($a), )); - } - else { + } else { info( t('No matches') . EOL); }