aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-08-16 02:18:46 +0000
committerMario <mario@mariovavti.com>2019-08-16 19:33:38 +0200
commitc997360b4a536174db062eb28d7f9689998b134b (patch)
treeacc028025cdfa45216fe825f9101e87f8e1b1fbf
parent88fa18204f2c54ed3096ea94f7715bf2b1fe4fff (diff)
downloadvolse-hubzilla-c997360b4a536174db062eb28d7f9689998b134b.tar.gz
volse-hubzilla-c997360b4a536174db062eb28d7f9689998b134b.tar.bz2
volse-hubzilla-c997360b4a536174db062eb28d7f9689998b134b.zip
show correct profile photo when previewing and editing profiles
(cherry picked from commit 808baf203d8c7aa57d89a3d5412742a4c84934b6)
-rw-r--r--include/channel.php10
1 files changed, 9 insertions, 1 deletions
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) {