2011-01-21 04:39:15 -05:00
|
|
|
<?php
|
|
|
|
|
2011-04-08 02:10:43 -04:00
|
|
|
function advanced_profile(&$a) {
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2012-04-17 07:33:50 -04:00
|
|
|
$o = '';
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
$o .= '<h2>' . t('Profile') . '</h2>';
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($a->profile['name']) {
|
2011-04-08 02:10:43 -04:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
$tpl = get_markup_template('profile_advanced.tpl');
|
|
|
|
|
|
|
|
$profile = array();
|
|
|
|
|
|
|
|
$profile['fullname'] = array( t('Full Name:'), $a->profile['name'] ) ;
|
|
|
|
|
|
|
|
if($a->profile['gender']) $profile['gender'] = array( t('Gender:'), $a->profile['gender'] );
|
|
|
|
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if(($a->profile['dob']) && ($a->profile['dob'] != '0000-00-00')) {
|
|
|
|
|
|
|
|
$year_bd_format = t('j F, Y');
|
|
|
|
$short_bd_format = t('j F');
|
2011-04-08 02:10:43 -04:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
|
|
|
|
$val = ((intval($a->profile['dob']))
|
|
|
|
? day_translate(datetime_convert('UTC','UTC',$a->profile['dob'] . ' 00:00 +00:00',$year_bd_format))
|
2012-05-28 00:36:20 -04:00
|
|
|
: day_translate(datetime_convert('UTC','UTC','2001-' . substr($a->profile['dob'],5) . ' 00:00 +00:00',$short_bd_format)));
|
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
$profile['birthday'] = array( t('Birthday:'), $val);
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
}
|
2011-04-08 02:10:43 -04:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($age = age($a->profile['dob'],$a->profile['timezone'],'')) $profile['age'] = array( t('Age:'), $age );
|
|
|
|
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($a->profile['marital']) $profile['marital'] = array( t('Status:'), $a->profile['marital']);
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-04-08 02:10:43 -04:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($a->profile['with']) $profile['marital']['with'] = $a->profile['with'];
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2012-06-02 05:30:26 -04:00
|
|
|
if(strlen($a->profile['howlong']) && $a->profile['howlong'] !== '0000-00-00 00:00:00') {
|
|
|
|
$profile['howlong'] = relative_date($a->profile['howlong'], t('for %1$d %2$s'));
|
|
|
|
}
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($a->profile['sexual']) $profile['sexual'] = array( t('Sexual Preference:'), $a->profile['sexual'] );
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($a->profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) );
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2012-06-02 23:58:20 -04:00
|
|
|
if($a->profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify($a->profile['hometown']) );
|
|
|
|
|
2012-02-11 04:24:29 -05:00
|
|
|
if($a->profile['pub_keywords']) $profile['pub_keywords'] = array( t('Tags:'), $a->profile['pub_keywords']);
|
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($a->profile['politic']) $profile['politic'] = array( t('Political Views:'), $a->profile['politic']);
|
2011-04-08 02:10:43 -04:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($a->profile['religion']) $profile['religion'] = array( t('Religion:'), $a->profile['religion']);
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($txt = prepare_text($a->profile['about'])) $profile['about'] = array( t('About:'), $txt );
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($txt = prepare_text($a->profile['interest'])) $profile['interest'] = array( t('Hobbies/Interests:'), $txt);
|
2011-04-08 02:10:43 -04:00
|
|
|
|
2012-06-25 00:16:55 -04:00
|
|
|
if($txt = prepare_text($a->profile['likes'])) $profile['likes'] = array( t('Likes:'), $txt);
|
|
|
|
|
|
|
|
if($txt = prepare_text($a->profile['dislikes'])) $profile['dislikes'] = array( t('Dislikes:'), $txt);
|
|
|
|
|
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($txt = prepare_text($a->profile['contact'])) $profile['contact'] = array( t('Contact information and Social Networks:'), $txt);
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($txt = prepare_text($a->profile['music'])) $profile['music'] = array( t('Musical interests:'), $txt);
|
|
|
|
|
|
|
|
if($txt = prepare_text($a->profile['book'])) $profile['book'] = array( t('Books, literature:'), $txt);
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($txt = prepare_text($a->profile['tv'])) $profile['tv'] = array( t('Television:'), $txt);
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($txt = prepare_text($a->profile['film'])) $profile['film'] = array( t('Film/dance/culture/entertainment:'), $txt);
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($txt = prepare_text($a->profile['romance'])) $profile['romance'] = array( t('Love/Romance:'), $txt);
|
|
|
|
|
|
|
|
if($txt = prepare_text($a->profile['work'])) $profile['work'] = array( t('Work/employment:'), $txt);
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2011-10-10 10:48:38 -04:00
|
|
|
if($txt = prepare_text($a->profile['education'])) $profile['education'] = array( t('School/education:'), $txt );
|
2014-07-03 12:39:22 -04:00
|
|
|
|
|
|
|
if ($a->profile['uid'] == local_user())
|
|
|
|
$profile['edit'] = array($a->get_baseurl(). '/profiles/'.$a->profile['id'], t('Edit profile'),"", t('Edit profile'));
|
|
|
|
|
2012-04-17 07:33:50 -04:00
|
|
|
return replace_macros($tpl, array(
|
2014-07-03 12:39:22 -04:00
|
|
|
'$title' => t('Profile'),
|
|
|
|
'$profile' => $profile
|
2012-04-17 07:33:50 -04:00
|
|
|
));
|
|
|
|
}
|
2011-01-21 04:39:15 -05:00
|
|
|
|
2012-04-17 07:33:50 -04:00
|
|
|
return '';
|
2011-04-08 02:10:43 -04:00
|
|
|
}
|