X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fprofile_advanced.php;h=8dfb1beecc3744d2661efb34dddb490cf01619f8;hb=96a41a16fd90492a9fca62fc675c9e09e0979a88;hp=22e035fe64758178de83b3bb47ef9ffa6560d227;hpb=5792b3d3580b9f09460305858293398d8d8a9abf;p=friendica.git diff --git a/include/profile_advanced.php b/include/profile_advanced.php index 22e035fe64..8dfb1beecc 100644 --- a/include/profile_advanced.php +++ b/include/profile_advanced.php @@ -2,257 +2,89 @@ function advanced_profile(&$a) { -$o .= ''; + $o = ''; -$o .= '

' . t('Profile') . '

'; + $o .= '

' . t('Profile') . '

'; -if($a->profile['name']) { - $lbl_fullname = t('Full Name:'); - $fullname = $a->profile['name']; + if($a->profile['name']) { -$o .= <<< EOT -
-
$lbl_fullname
-
$fullname
-
-
-EOT; -} + $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'] ); + -if($a->profile['gender']) { - $lbl_gender = t('Gender:'); - $gender = $a->profile['gender']; - -$o .= <<< EOT -
-
$lbl_gender
-
$gender
-
-
-EOT; -} + if(($a->profile['dob']) && ($a->profile['dob'] != '0000-00-00')) { + + $year_bd_format = t('j F, Y'); + $short_bd_format = t('j F'); -if(($a->profile['dob']) && ($a->profile['dob'] != '0000-00-00')) { - $lbl_birthday = t('Birthday:'); + + $val = ((intval($a->profile['dob'])) + ? day_translate(datetime_convert('UTC','UTC',$a->profile['dob'] . ' 00:00 +00:00',$year_bd_format)) + : day_translate(datetime_convert('UTC','UTC','2001-' . substr($a->profile['dob'],5) . ' 00:00 +00:00',$short_bd_format))); -$o .= <<< EOT -
-
$lbl_birthday
-EOT; + $profile['birthday'] = array( t('Birthday:'), $val); -// If no year, add an arbitrary one so just we can parse the month and day. + } -$year_bd_format = t('j F, Y'); -$short_bd_format = t('j F'); + if($age = age($a->profile['dob'],$a->profile['timezone'],'')) $profile['age'] = array( t('Age:'), $age ); + -$o .= '
' - . ((intval($a->profile['dob'])) - ? day_translate(datetime_convert('UTC','UTC',$a->profile['dob'] . ' 00:00 +00:00',$year_bd_format)) - : day_translate(datetime_convert('UTC','UTC','2001-' . substr($a->profile['dob'],6) . ' 00:00 +00:00',$short_bd_format))) - . "
\r\n
"; + if($a->profile['marital']) $profile['marital'] = array( t('Status:'), $a->profile['marital']); -$o .= '
'; -} + if($a->profile['with']) $profile['marital']['with'] = $a->profile['with']; -if($age = age($a->profile['dob'],$a->profile['timezone'],'')) { - $lbl_age = t('Age:'); -$o .= <<< EOT -
-
$lbl_age
-
$age
-
-
-EOT; -} + 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')); + } -if($a->profile['marital']) { - $lbl_marital = t(' Status:'); - $marital = $a->profile['marital']; + if($a->profile['sexual']) $profile['sexual'] = array( t('Sexual Preference:'), $a->profile['sexual'] ); -$o .= <<< EOT -
-
$lbl_marital
-
$marital
-EOT; + if($a->profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) ); -if($a->profile['with']) { - $with = $a->profile['with']; - $o .= "
($with)
"; -} -$o .= <<< EOT -
-
-EOT; -} + if($a->profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify($a->profile['hometown']) ); -if($a->profile['sexual']) { - $lbl_sexual = t('Sexual Preference:'); - $sexual = $a->profile['sexual']; - -$o .= <<< EOT -
-
$lbl_sexual
-
$sexual
-
-
-EOT; -} + if($a->profile['pub_keywords']) $profile['pub_keywords'] = array( t('Tags:'), $a->profile['pub_keywords']); -if($a->profile['homepage']) { - $lbl_homepage = t('Homepage:'); - $homepage = linkify($a->profile['homepage']); -$o .= <<< EOT -
-
$lbl_homepage
-
$homepage
-
-
-EOT; -} + if($a->profile['politic']) $profile['politic'] = array( t('Political Views:'), $a->profile['politic']); -if($a->profile['politic']) { - $lbl_politic = t('Political Views:'); - $politic = $a->profile['politic']; -$o .= <<< EOT -
-
$lbl_politic
-
$politic
-
-
-EOT; -} + if($a->profile['religion']) $profile['religion'] = array( t('Religion:'), $a->profile['religion']); -if($a->profile['religion']) { - $lbl_religion = t('Religion:'); - $religion = $a->profile['religion']; -$o .= <<< EOT -
-
$lbl_religion
-
$religion
-
-
-EOT; -} -if($txt = prepare_text($a->profile['about'])) { - $lbl_about = t('About:'); -$o .= <<< EOT -
-
$lbl_about
-
-
$txt
-
-
-EOT; -} + if($txt = prepare_text($a->profile['about'])) $profile['about'] = array( t('About:'), $txt ); -if($txt = prepare_text($a->profile['interest'])) { - $lbl_interests = t('Hobbies/Interests:'); -$o .= <<< EOT -
-
$lbl_interests
-
-
$txt
-
-
-EOT; -} + if($txt = prepare_text($a->profile['interest'])) $profile['interest'] = array( t('Hobbies/Interests:'), $txt); -if($txt = prepare_text($a->profile['contact'])) { - $lbl_contact = t('Contact information and Social Networks:'); -$o .= <<< EOT -
-
$lbl_contact
-
-
$txt
-
-
-EOT; -} + if($txt = prepare_text($a->profile['likes'])) $profile['likes'] = array( t('Likes:'), $txt); -if($txt = prepare_text($a->profile['music'])) { - $lbl_music = t('Musical interests:'); -$o .= <<< EOT -
-
$lbl_music
-
-
$txt
-
-
-EOT; -} + if($txt = prepare_text($a->profile['dislikes'])) $profile['dislikes'] = array( t('Dislikes:'), $txt); -if($txt = prepare_text($a->profile['book'])) { - $lbl_book = t('Books, literature:'); -$o .= <<< EOT -
-
$lbl_book
-
-
$txt
-
-
-EOT; -} -if($txt = prepare_text($a->profile['tv'])) { - $lbl_tv = t('Television:'); -$o .= <<< EOT -
-
$lbl_tv
-
-
$txt
-
-
-EOT; -} + if($txt = prepare_text($a->profile['contact'])) $profile['contact'] = array( t('Contact information and Social Networks:'), $txt); -if($txt = prepare_text($a->profile['film'])) { - $lbl_film = t('Film/dance/culture/entertainment:'); -$o .= <<< EOT -
-
$lbl_film
-
-
$txt
-
-
-EOT; -} + 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); -if($txt = prepare_text($a->profile['romance'])) { - $lbl_romance = t('Love/Romance:'); -$o .= <<< EOT -
-
$lbl_romance
-
-
$txt
-
-
-EOT; -} + if($txt = prepare_text($a->profile['tv'])) $profile['tv'] = array( t('Television:'), $txt); -if($txt = prepare_text($a->profile['work'])) { - $lbl_work = t('Work/employment:'); -$o .= <<< EOT -
-
$lbl_work
-
-
$txt
-
-
-EOT; -} + if($txt = prepare_text($a->profile['film'])) $profile['film'] = array( t('Film/dance/culture/entertainment:'), $txt); -if($txt = prepare_text($a->profile['education'])) { - $lbl_education = t('School/education:'); -$o .= <<< EOT -
-
$lbl_education
-
-
$txt
-
-
-EOT; -} + 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); + + if($txt = prepare_text($a->profile['education'])) $profile['education'] = array( t('School/education:'), $txt ); + + return replace_macros($tpl, array( + '$title' => t('Profile'), + '$profile' => $profile, + )); + } -return $o; + return ''; }