Use the contact picture instead of the profile picture

This commit is contained in:
Michael 2017-05-17 06:00:20 +00:00
parent 80103f8ad9
commit 7daf5ecde1

View file

@ -152,7 +152,9 @@ function get_profiledata_by_nick($nickname, $uid = 0, $profile = 0) {
if ($profile) { if ($profile) {
$profile_int = intval($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`.* `contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.*
FROM `profile` FROM `profile`
INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` AND `contact`.`self` 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)) { 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`.* `contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.*
FROM `profile` FROM `profile`
INNER JOIN `contact` ON `contact`.`uid` = `profile`.`uid` AND `contact`.`self` INNER JOIN `contact` ON `contact`.`uid` = `profile`.`uid` AND `contact`.`self`
@ -365,9 +369,9 @@ function profile_sidebar($profile, $block = 0) {
'fullname' => $profile['name'], 'fullname' => $profile['name'],
'firstname' => $firstname, 'firstname' => $firstname,
'lastname' => $lastname, 'lastname' => $lastname,
'photo300' => App::get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg', 'photo300' => $profile['contact_photo'],
'photo100' => App::get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg', 'photo100' => $profile['contact_thumb'],
'photo50' => App::get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg', 'photo50' => $profile['contact_micro'],
); );
else else
$diaspora = false; $diaspora = false;
@ -410,9 +414,11 @@ function profile_sidebar($profile, $block = 0) {
else else
$p["address"] = bbcode($p["location"]); $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); $p["photo"] = proxy_url($p["photo"], false, PROXY_SIZE_SMALL);
}
if ($a->theme['template_engine'] === 'internal') if ($a->theme['template_engine'] === 'internal')
$location = template_escape($location); $location = template_escape($location);