]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
Merge develop into 0602_contact_profile
[friendica.git] / mod / display.php
index c41d2f045fcf7ff4b6b2c0204175193737cdcb45..4e33927072bdf8123e17abc7a485a22dd768666a 100644 (file)
@@ -186,19 +186,26 @@ function display_fetchauthor($a, $item) {
 
        // Fetching profile data from global contacts
        if ($profiledata["network"] != NETWORK_FEED) {
-               $r = q("SELECT `name`, `photo`, `nick`, `addr`, `location`, `about`, `gender`, `keywords` FROM `gcontact` WHERE `nurl` = '%s'", dbesc(normalise_link($profiledata["url"])));
+               $r = q("SELECT `name`, `photo`, `nick`, `addr`, `location`, `about`, `gender`, `keywords`, `network` FROM `gcontact` WHERE `nurl` = '%s'", dbesc(normalise_link($profiledata["url"])));
                if (count($r)) {
                        $profiledata["name"] = $r[0]["name"];
                        $profiledata["photo"] = $r[0]["photo"];
                        $profiledata["nickname"] = $r[0]["nick"];
                        $profiledata["addr"] = $r[0]["addr"];
-                       $profiledata["keywords"] = $r[0]["keywords"];
                        $profiledata["network"] = $r[0]["network"];
 
+                       if ($r[0]["keywords"])
+                               $profiledata["keywords"] = $r[0]["keywords"];
+
                        if ($showdetails) {
-                               $profiledata["address"] = $r[0]["location"];
-                               $profiledata["about"] = $r[0]["about"];
-                               $profiledata["gender"] = $r[0]["gender"];
+                               if ($r[0]["location"])
+                                       $profiledata["address"] = $r[0]["location"];
+
+                               if ($r[0]["about"])
+                                       $profiledata["about"] = $r[0]["about"];
+
+                               if ($r[0]["gender"])
+                                       $profiledata["gender"] = $r[0]["gender"];
                        }
                }
        }
@@ -340,6 +347,10 @@ function display_content(&$a, $update = 0) {
                return;
        }
 
+       // Why do we need this on the display page? We don't have the possibility to write new content here.
+       // Ad editing of posts work without this as well.
+       // We should remove this completely for the 3.5.1 release.
+       /*
        if ($is_owner) {
                $x = array(
                        'is_owner' => true,
@@ -355,6 +366,7 @@ function display_content(&$a, $update = 0) {
                );
                $o .= status_editor($a,$x,0,true);
        }
+       */
 
        $sql_extra = item_permissions_sql($a->profile['uid'],$remote_contact,$groups);