X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FProfile.php;h=8bb519448e32d18a2fd179f7fe881b0668ab86c4;hb=7d6b1264ec038bc9c3917bc933ba8d02bedadcbc;hp=2238b3aac5dad148b27e50325dad44219d070b5d;hpb=08afec3170857152d4d76fafa3611cb55b066eee;p=friendica.git diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 2238b3aac5..8bb519448e 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -92,14 +92,14 @@ class Profile { $user = dba::selectFirst('user', ['uid'], ['nickname' => $nickname]); - if (!$user && !count($user) && !count($profiledata)) { + if (!DBM::is_result($user) && empty($profiledata)) { logger('profile error: ' . $a->query_string, LOGGER_DEBUG); notice(L10n::t('Requested account is not available.') . EOL); $a->error = 404; return; } - if (!x($a->page, 'aside')) { + if (empty($a->page['aside'])) { $a->page['aside'] = ''; } @@ -152,15 +152,11 @@ class Profile $a->set_template_engine(); // reset the template engine to the default in case the user's theme doesn't specify one - $theme_info_file = 'view/theme/' . current_theme() . '/theme.php'; + $theme_info_file = 'view/theme/' . $a->getCurrentTheme() . '/theme.php'; if (file_exists($theme_info_file)) { require_once $theme_info_file; } - if (!x($a->page, 'aside')) { - $a->page['aside'] = ''; - } - if (local_user() && local_user() == $a->profile['uid'] && $profiledata) { $a->page['aside'] .= replace_macros( get_markup_template('profile_edlink.tpl'), @@ -643,12 +639,10 @@ class Profile $bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18 $classtoday = ''; - $self = dba::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]); - $s = dba::p( - "SELECT * + "SELECT `event`.* FROM `event` - JOIN `item` + INNER JOIN `item` ON `item`.`uid` = `event`.`uid` AND `item`.`parent-uri` = `event`.`uri` WHERE `event`.`uid` = ? @@ -663,7 +657,7 @@ class Profile local_user(), DateTimeFormat::utc('now + 7 days'), DateTimeFormat::utc('now - 1 days'), - $self['id'], + public_contact(), ACTIVITY_ATTEND, ACTIVITY_ATTENDMAYBE ); @@ -956,7 +950,7 @@ class Profile ]; } - if ((!$is_owner) && ((count($a->profile)) || (!$a->profile['hide-friends']))) { + if (!$is_owner && empty($a->profile['hide-friends'])) { $tabs[] = [ 'label' => L10n::t('Contacts'), 'url' => System::baseUrl() . '/viewcontacts/' . $nickname,