use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\Core\System;
+use Friendica\Core\Theme;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
+use Friendica\Protocol\Activity;
use Friendica\Protocol\Diaspora;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
$location .= $profile['locality'];
}
- if (!empty($profile['region']) && (defaults($profile, 'locality', '') != $profile['region'])) {
+ if (!empty($profile['region']) && (($profile['locality'] ?? '') != $profile['region'])) {
if ($location) {
$location .= ', ';
}
$a->page['title'] = $a->profile['name'] . ' @ ' . Config::get('config', 'sitename');
if (!$profiledata && !PConfig::get(local_user(), 'system', 'always_my_theme')) {
- $_SESSION['theme'] = $a->profile['theme'];
+ $a->setCurrentTheme($a->profile['theme']);
+ $a->setCurrentMobileTheme($a->profile['mobile-theme']);
}
- $_SESSION['mobile-theme'] = $a->profile['mobile-theme'];
-
/*
* load/reload current theme info
*/
return $o;
}
- $profile['picdate'] = urlencode(defaults($profile, 'picdate', ''));
+ $profile['picdate'] = urlencode($profile['picdate'] ?? '');
if (($profile['network'] != '') && ($profile['network'] != Protocol::DFRN)) {
$profile['network_link'] = Strings::formatNetworkName($profile['network'], $profile['url']);
if (Contact::canReceivePrivateMessages($profile)) {
if ($visitor_is_followed || $visitor_is_following) {
- $wallmessage_link = $visitor_base_path . '/message/new/' . base64_encode(defaults($profile, 'addr', ''));
+ $wallmessage_link = $visitor_base_path . '/message/new/' . base64_encode($profile['addr'] ?? '');
} elseif ($visitor_is_authenticated && !empty($profile['unkmail'])) {
$wallmessage_link = 'wallmessage/' . $profile['nickname'];
}
$diaspora = [
'guid' => $profile['guid'],
'podloc' => System::baseUrl(),
- 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
+ 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false'),
'nickname' => $profile['nickname'],
'fullname' => $profile['name'],
'firstname' => $firstname,
'lastname' => $lastname,
- 'photo300' => defaults($profile, 'contact_photo', ''),
- 'photo100' => defaults($profile, 'contact_thumb', ''),
- 'photo50' => defaults($profile, 'contact_micro', ''),
+ 'photo300' => $profile['contact_photo'] ?? '',
+ 'photo100' => $profile['contact_thumb'] ?? '',
+ 'photo50' => $profile['contact_micro'] ?? '',
];
} else {
$diaspora = false;
$p['photo'] = ProxyUtils::proxifyUrl($p['photo'], false, ProxyUtils::SIZE_SMALL);
}
- $p['url'] = Contact::magicLink(defaults($p, 'url', $profile_url));
+ $p['url'] = Contact::magicLink(($p['url'] ?? '') ?: $profile_url);
$tpl = Renderer::getMarkupTemplate('profile_vcard.tpl');
$o .= Renderer::replaceMacros($tpl, [
while ($rr = DBA::fetch($s)) {
$condition = ['parent-uri' => $rr['uri'], 'uid' => $rr['uid'], 'author-id' => public_contact(),
- 'activity' => [Item::activityToIndex(ACTIVITY_ATTEND), Item::activityToIndex(ACTIVITY_ATTENDMAYBE)],
+ 'activity' => [Item::activityToIndex( Activity::ATTEND), Item::activityToIndex(Activity::ATTENDMAYBE)],
'visible' => true, 'deleted' => false];
if (!Item::exists($condition)) {
continue;
$profile['religion'] = [L10n::t('Religion:'), $a->profile['religion']];
}
- if ($txt = prepare_text($a->profile['about'])) {
+ if ($txt = BBCode::convert($a->profile['about'])) {
$profile['about'] = [L10n::t('About:'), $txt];
}
- if ($txt = prepare_text($a->profile['interest'])) {
+ if ($txt = BBCode::convert($a->profile['interest'])) {
$profile['interest'] = [L10n::t('Hobbies/Interests:'), $txt];
}
- if ($txt = prepare_text($a->profile['likes'])) {
+ if ($txt = BBCode::convert($a->profile['likes'])) {
$profile['likes'] = [L10n::t('Likes:'), $txt];
}
- if ($txt = prepare_text($a->profile['dislikes'])) {
+ if ($txt = BBCode::convert($a->profile['dislikes'])) {
$profile['dislikes'] = [L10n::t('Dislikes:'), $txt];
}
- if ($txt = prepare_text($a->profile['contact'])) {
+ if ($txt = BBCode::convert($a->profile['contact'])) {
$profile['contact'] = [L10n::t('Contact information and Social Networks:'), $txt];
}
- if ($txt = prepare_text($a->profile['music'])) {
+ if ($txt = BBCode::convert($a->profile['music'])) {
$profile['music'] = [L10n::t('Musical interests:'), $txt];
}
- if ($txt = prepare_text($a->profile['book'])) {
+ if ($txt = BBCode::convert($a->profile['book'])) {
$profile['book'] = [L10n::t('Books, literature:'), $txt];
}
- if ($txt = prepare_text($a->profile['tv'])) {
+ if ($txt = BBCode::convert($a->profile['tv'])) {
$profile['tv'] = [L10n::t('Television:'), $txt];
}
- if ($txt = prepare_text($a->profile['film'])) {
+ if ($txt = BBCode::convert($a->profile['film'])) {
$profile['film'] = [L10n::t('Film/dance/culture/entertainment:'), $txt];
}
- if ($txt = prepare_text($a->profile['romance'])) {
+ if ($txt = BBCode::convert($a->profile['romance'])) {
$profile['romance'] = [L10n::t('Love/Romance:'), $txt];
}
- if ($txt = prepare_text($a->profile['work'])) {
+ if ($txt = BBCode::convert($a->profile['work'])) {
$profile['work'] = [L10n::t('Work/employment:'), $txt];
}
- if ($txt = prepare_text($a->profile['education'])) {
+ if ($txt = BBCode::convert($a->profile['education'])) {
$profile['education'] = [L10n::t('School/education:'), $txt];
}