]> git.mxchange.org Git - friendica.git/blobdiff - include/Contact.php
Bugfix: probing failed when a profile was hidden
[friendica.git] / include / Contact.php
index 936589be9844593b7b87352ac3950d5f2cdd114c..6daba33844dc04c76c04668a194bb6b5a5538a38 100644 (file)
@@ -223,7 +223,7 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) {
        // Fetch the data from the gcontact table
        if (!$r)
                $r = q("SELECT 0 AS `id`, 0 AS `cid`, `id` AS `gid`, 0 AS `zid`, 0 AS `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, '' AS `xmpp`,
-                       `keywords`, `gender`, `photo`, `photo` AS `thumb`, `photo` AS `micro`, `community` AS `forum`, 0 AS `prv`, `community`, 0 AS `contact-type`, `birthday`, 0 AS `self`
+                       `keywords`, `gender`, `photo`, `photo` AS `thumb`, `photo` AS `micro`, `community` AS `forum`, 0 AS `prv`, `community`, `contact-type`, `birthday`, 0 AS `self`
                        FROM `gcontact` WHERE `nurl` = '%s'",
                                dbesc(normalise_link($url)));
 
@@ -694,6 +694,9 @@ function formatted_location($profile) {
 function account_type($contact) {
 
        // There are several fields that indicate that the contact or user is a forum
+       // "page-flags" is a field in the user table,
+       // "forum" and "prv" are used in the contact table. They stand for PAGE_COMMUNITY and PAGE_PRVGROUP.
+       // "community" is used in the gcontact table and is true if the contact is PAGE_COMMUNITY or PAGE_PRVGROUP.
        if((isset($contact['page-flags']) && (intval($contact['page-flags']) == PAGE_COMMUNITY))
                || (isset($contact['page-flags']) && (intval($contact['page-flags']) == PAGE_PRVGROUP))
                || (isset($contact['forum']) && intval($contact['forum']))
@@ -703,7 +706,7 @@ function account_type($contact) {
        else
                $type = ACCOUNT_TYPE_PERSON;
 
-       // The field is named differently in the user and the contact record
+       // The "contact-type" (contact table) and "account-type" (user table) are more general then the chaos from above.
        if (isset($contact["contact-type"]))
                $type = $contact["contact-type"];
        if (isset($contact["account-type"]))