$o = '';
$location = false;
$address = false;
-// $pdesc = true;
+ // $pdesc = true;
- if ((! is_array($profile)) && (! count($profile)))
+ // This function can also use contact information in $profile
+ $is_contact = x($profile, 'cid');
+
+ if ((! is_array($profile)) && (! count($profile))) {
return $o;
+ }
$profile['picdate'] = urlencode($profile['picdate']);
if (($profile['network'] != "") AND ($profile['network'] != NETWORK_DFRN)) {
- $profile['network_name'] = format_network_name($profile['network'],$profile['url']);
- } else
+ $profile['network_name'] = format_network_name($profile['network'], $profile['url']);
+ } else {
$profile['network_name'] = "";
+ }
call_hooks('profile_sidebar_enter', $profile);
}
// show edit profile to yourself
- if ($profile['uid'] == local_user() && feature_enabled(local_user(),'multi_profiles')) {
+ if (!$is_contact && $profile['uid'] == local_user() && feature_enabled(local_user(),'multi_profiles')) {
$profile['edit'] = array(App::get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
$r = q("SELECT * FROM `profile` WHERE `uid` = %d",
local_user());
}
}
- if ($profile['uid'] == local_user() && !feature_enabled(local_user(),'multi_profiles')) {
+ if (!$is_contact && $profile['uid'] == local_user() && !feature_enabled(local_user(),'multi_profiles')) {
$profile['edit'] = array(App::get_baseurl(). '/profiles/'.$profile['id'], t('Edit profile'),"", t('Edit profile'));
$profile['menu'] = array(
'chg_photo' => t('Change profile photo'),
if ($a->profile['gender']) $profile['gender'] = array( t('Gender:'), $a->profile['gender'] );
-
- if (($a->profile['dob']) && ($a->profile['dob'] != '0000-00-00')) {
-
+ if (($a->profile['dob']) && ($a->profile['dob'] > '0001-01-01')) {
$year_bd_format = t('j F, Y');
$short_bd_format = t('j F');
$profile['marital']['with'] = $a->profile['with'];
}
- if (strlen($a->profile['howlong']) && $a->profile['howlong'] !== '0000-00-00 00:00:00') {
+ if (strlen($a->profile['howlong']) && $a->profile['howlong'] >= NULL_DATE) {
$profile['howlong'] = relative_date($a->profile['howlong'], t('for %1$d %2$s'));
}