]> git.mxchange.org Git - friendica.git/blobdiff - include/Contact.php
The contact template now displays the address if available
[friendica.git] / include / Contact.php
index 04cf3b43953063dcb835db720f14efb9aaeacd5d..5138f276be4a9c5a192766d9fc5c7167cfac113d 100644 (file)
@@ -198,12 +198,16 @@ function get_contact_details_by_url($url, $uid = -1) {
        if ($uid == -1)
                $uid = local_user();
 
-       $r = q("SELECT `url`, `name`, `nick`, `addr`. `photo`, `location`, `about`, `keywords`, `gender`, `community`, `network` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
+       $r = q("SELECT `id` AS `gid`, `url`, `name`, `nick`, `addr`, `photo`, `location`, `about`, `keywords`, `gender`, `community`, `network` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
                dbesc(normalise_link($url)));
 
-       if ($r)
+       if ($r) {
                $profile = $r[0];
-       else {
+
+               if ($profile["addr"] == "")
+                       proc_run('php',"include/update_gcontact.php", $profile["gid"]);
+
+       } else {
                $r = q("SELECT `url`, `name`, `nick`, `avatar` AS `photo`, `location`, `about` FROM `unique_contacts` WHERE `url` = '%s'",
                        dbesc(normalise_link($url)));