]> git.mxchange.org Git - friendica.git/blobdiff - include/update_gcontact.php
Merge pull request #3868 from rabuzarus/20171104_-_use_best_link_url_for_events
[friendica.git] / include / update_gcontact.php
index 2f69bc7fe3099a2de6ddd7c62bac26db7c00dc34..97c825352eb26919930ea92c99727077875389d9 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 
-use \Friendica\Core\Config;
+use Friendica\Core\Config;
 
-function update_gcontact_run(&$argv, &$argc){
+function update_gcontact_run(&$argv, &$argc) {
        global $a;
 
-       require_once('include/Scrape.php');
-       require_once('include/socgraph.php');
+       require_once 'include/probe.php';
+       require_once 'include/socgraph.php';
 
        logger('update_gcontact: start');
 
@@ -25,37 +25,33 @@ function update_gcontact_run(&$argv, &$argc){
                return;
        }
 
-       if (!in_array($r[0]["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) }
+       if (!in_array($r[0]["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) {
                return;
        }
 
        $data = probe_url($r[0]["url"]);
 
        if (!in_array($data["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) {
-               if ($r[0]["server_url"] != "") {
+               if ($r[0]["server_url"] != "")
                        poco_check_server($r[0]["server_url"], $r[0]["network"]);
-               }
 
                q("UPDATE `gcontact` SET `last_failure` = '%s' WHERE `id` = %d",
                        dbesc(datetime_convert()), intval($contact_id));
                return;
        }
 
-       if (($data["name"] == "") AND ($r[0]['name'] != "")) {
+       if (($data["name"] == "") && ($r[0]['name'] != ""))
                $data["name"] = $r[0]['name'];
-       }
 
-       if (($data["nick"] == "") AND ($r[0]['nick'] != "")) {
+       if (($data["nick"] == "") && ($r[0]['nick'] != ""))
                $data["nick"] = $r[0]['nick'];
-       }
 
-       if (($data["addr"] == "") AND ($r[0]['addr'] != "")) {
+       if (($data["addr"] == "") && ($r[0]['addr'] != ""))
                $data["addr"] = $r[0]['addr'];
-       }
 
-       if (($data["photo"] == "") AND ($r[0]['photo'] != "")) {
+       if (($data["photo"] == "") && ($r[0]['photo'] != ""))
                $data["photo"] = $r[0]['photo'];
-       }
+
 
        q("UPDATE `gcontact` SET `name` = '%s', `nick` = '%s', `addr` = '%s', `photo` = '%s'
                                WHERE `id` = %d",