$r = false;
}
+ $remoteUser = null;
if (DBA::isResult($r)) {
$nav['userinfo'] = [
'icon' => (DBA::isResult($r) ? $r[0]['photo'] : 'images/person-48.jpg'),
'name' => $r[0]['name'],
];
+ $remoteUser = $r[0];
}
- if (!local_user() && !empty($server_url)) {
- $nav['logout'] = [$server_url . '/logout', L10n::t('Logout'), '', L10n::t('End this session')];
-
+ if (!local_user() && !empty($server_url) && !is_null($remoteUser)) {
// user menu
- $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'], L10n::t('Status'), '', L10n::t('Your posts and conversations')];
- $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', L10n::t('Profile'), '', L10n::t('Your profile page')];
- $nav['usermenu'][] = [$server_url . '/photos/' . $a->user['nickname'], L10n::t('Photos'), '', L10n::t('Your photos')];
- $nav['usermenu'][] = [$server_url . '/videos/' . $a->user['nickname'], L10n::t('Videos'), '', L10n::t('Your videos')];
+ $nav['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], L10n::t('Status'), '', L10n::t('Your posts and conversations')];
+ $nav['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '?tab=profile', L10n::t('Profile'), '', L10n::t('Your profile page')];
+ $nav['usermenu'][] = [$server_url . '/photos/' . $remoteUser['nick'], L10n::t('Photos'), '', L10n::t('Your photos')];
+ $nav['usermenu'][] = [$server_url . '/videos/' . $remoteUser['nick'], L10n::t('Videos'), '', L10n::t('Your videos')];
$nav['usermenu'][] = [$server_url . '/events/', L10n::t('Events'), '', L10n::t('Your events')];
// navbar links