use Friendica\Network\Probe;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
+use Friendica\Module\Login;
function profiles_init(App $a) {
Profile::load($a, $a->user['nickname'], $r[0]['id']);
}
-
-
-
}
-function profile_clean_keywords($keywords) {
+function profile_clean_keywords($keywords)
+{
$keywords = str_replace(",", " ", $keywords);
$keywords = explode(" ", $keywords);
if (! local_user()) {
notice(L10n::t('Permission denied.') . EOL);
- return;
+ return Login::form();
}
$o = '';
$a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), [
'$baseurl' => System::baseUrl(true),
]);
- $a->page['end'] .= replace_macros(get_markup_template('profed_end.tpl'), [
- '$baseurl' => System::baseUrl(true),
- ]);
$opt_tpl = get_markup_template("profile-hide-friends.tpl");
$hide_friends = replace_macros($opt_tpl,[
]);
$personal_account = !(in_array($a->user["page-flags"],
- [PAGE_COMMUNITY, PAGE_PRVGROUP]));
+ [Contact::PAGE_COMMUNITY, Contact::PAGE_PRVGROUP]));
$detailled_profile = (PConfig::get(local_user(), 'system', 'detailled_profile') AND $personal_account);
'$country_name' => ['country_name', L10n::t('Country:'), $r[0]['country-name']],
'$age' => ((intval($r[0]['dob'])) ? '(' . L10n::t('Age: ') . Temporal::getAgeByTimezone($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
'$gender' => ContactSelector::gender($r[0]['gender']),
- '$marital' => ContactSelector::maritalStatus($r[0]['marital']),
+ '$marital' => ['selector' => ContactSelector::maritalStatus($r[0]['marital']), 'value' => $r[0]['marital']],
'$with' => ['with', L10n::t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), L10n::t('Examples: cathy123, Cathy Williams, cathy@example.com')],
'$howlong' => ['howlong', L10n::t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : DateTimeFormat::local($r[0]['howlong']))],
- '$sexual' => ContactSelector::sexualPreference($r[0]['sexual']),
+ '$sexual' => ['selector' => ContactSelector::sexualPreference($r[0]['sexual']), 'value' => $r[0]['sexual']],
'$about' => ['about', L10n::t('Tell us about yourself...'), $r[0]['about']],
'$xmpp' => ['xmpp', L10n::t("XMPP \x28Jabber\x29 address:"), $r[0]['xmpp'], L10n::t("The XMPP address will be propagated to your contacts so that they can follow you.")],
'$homepage' => ['homepage', L10n::t('Homepage URL:'), $r[0]['homepage']],
$profiles = '';
foreach ($r as $rr) {
$profiles .= replace_macros($tpl, [
- '$photo' => $a->remove_baseurl($rr['thumb']),
+ '$photo' => $a->removeBaseURL($rr['thumb']),
'$id' => $rr['id'],
'$alt' => L10n::t('Profile Image'),
'$profile_name' => $rr['profile-name'],