]> git.mxchange.org Git - friendica.git/commitdiff
Use the contact picture instead of the profile picture
authorMichael <heluecht@pirati.ca>
Wed, 17 May 2017 06:00:20 +0000 (06:00 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 17 May 2017 06:00:20 +0000 (06:00 +0000)
include/identity.php

index 3ab25cdc45724e68e1cba99869f7ceeb23ec2954..d2f59a06e2257727990915d22068faa7e641a017 100644 (file)
@@ -152,7 +152,9 @@ function get_profiledata_by_nick($nickname, $uid = 0, $profile = 0) {
 
        if ($profile) {
                $profile_int = intval($profile);
-               $r = q("SELECT `contact`.`id` AS `contact_id`, `profile`.`uid` AS `profile_uid`, `profile`.*,
+               $r = q("SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` AS `contact_photo`,
+                               `contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
+                               `profile`.`uid` AS `profile_uid`, `profile`.*,
                                `contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.*
                        FROM `profile`
                        INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` AND `contact`.`self`
@@ -163,7 +165,9 @@ function get_profiledata_by_nick($nickname, $uid = 0, $profile = 0) {
                );
        }
        if (!dbm::is_result($r)) {
-               $r = q("SELECT `contact`.`id` AS `contact_id`, `profile`.`uid` AS `profile_uid`, `profile`.*,
+               $r = q("SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` as `contact_photo`,
+                               `contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
+                               `profile`.`uid` AS `profile_uid`, `profile`.*,
                                `contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.*
                        FROM `profile`
                        INNER JOIN `contact` ON `contact`.`uid` = `profile`.`uid` AND `contact`.`self`
@@ -365,9 +369,9 @@ function profile_sidebar($profile, $block = 0) {
                        'fullname' => $profile['name'],
                        'firstname' => $firstname,
                        'lastname' => $lastname,
-                       'photo300' => App::get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
-                       'photo100' => App::get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
-                       'photo50' => App::get_baseurl() . '/photo/custom/50/'  . $profile['uid'] . '.jpg',
+                       'photo300' => $profile['contact_photo'],
+                       'photo100' => $profile['contact_thumb'],
+                       'photo50' => $profile['contact_micro'],
                );
        else
                $diaspora = false;
@@ -410,9 +414,11 @@ function profile_sidebar($profile, $block = 0) {
        else
                $p["address"] = bbcode($p["location"]);
 
-       if (isset($p["photo"]))
+       if (isset($p["contact_photo"])) {
+               $p["photo"] = proxy_url($p["contact_photo"], false, PROXY_SIZE_SMALL);
+       } elseif (isset($p["photo"])) {
                $p["photo"] = proxy_url($p["photo"], false, PROXY_SIZE_SMALL);
-
+       }
        if ($a->theme['template_engine'] === 'internal')
                $location = template_escape($location);