From 808baf203d8c7aa57d89a3d5412742a4c84934b6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 15 Aug 2019 19:18:46 -0700 Subject: show correct profile photo when previewing and editing profiles --- include/channel.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/channel.php b/include/channel.php index 0280cd1cd..7c0397e11 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1262,7 +1262,7 @@ function channel_export_items_page($channel_id, $start, $finish, $page = 0, $lim */ function profile_load($nickname, $profile = '') { -// logger('profile_load: ' . $nickname . (($profile) ? ' profile: ' . $profile : '')); + //logger('profile_load: ' . $nickname . (($profile) ? ' profile: ' . $profile : '')); $user = q("select channel_id from channel where channel_address = '%s' and channel_removed = 0 limit 1", dbesc($nickname) @@ -1303,6 +1303,14 @@ function profile_load($nickname, $profile = '') { dbesc($nickname), dbesc($profile) ); + if (! $p) { + $p = q("SELECT profile.uid AS profile_uid, profile.*, channel.* FROM profile + LEFT JOIN channel ON profile.uid = channel.channel_id + WHERE channel.channel_address = '%s' AND profile.id = %d LIMIT 1", + dbesc($nickname), + intval($profile) + ); + } } if(! $p) { -- cgit v1.2.3