X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fprofile_advanced.php;h=004a58524b53385c03e32b43feca2759fb59301d;hb=d050762e4de5067567b3c5a60b7828239b1dda91;hp=c1dfad66f4e2c6f2dbc4e75a9887f3edf45417bc;hpb=0ddf84eb5a93729fbadc434f67fd92e098e7117e;p=friendica.git diff --git a/include/profile_advanced.php b/include/profile_advanced.php old mode 100644 new mode 100755 index c1dfad66f4..004a58524b --- a/include/profile_advanced.php +++ b/include/profile_advanced.php @@ -2,257 +2,80 @@ 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; -} - -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')) { - $lbl_birthday = t('Birthday:'); - -$o .= <<< EOT -
-
$lbl_birthday
-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 no year, add an arbitrary one so just we can parse the month and day. + if(($a->profile['dob']) && ($a->profile['dob'] != '0000-00-00')) { + + $year_bd_format = t('j F, Y'); + $short_bd_format = t('j F'); -$year_bd_format = t('j F, Y'); -$short_bd_format = t('j F'); + + $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'],6) . ' 00:00 +00:00',$short_bd_format))); + + $profile['birthday'] = array( t('Birthday:'), $val); -$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
"; + } -$o .= '
'; + if($age = age($a->profile['dob'],$a->profile['timezone'],'')) $profile['age'] = array( t('Age:'), $age ); + -} + if($a->profile['marital']) $profile['marital'] = array( t('Status:'), $a->profile['marital']); -if($age = age($a->profile['dob'],$a->profile['timezone'],'')) { - $lbl_age = t('Age:'); -$o .= <<< EOT -
-
$lbl_age
-
$age
-
-
-EOT; -} -if($a->profile['marital']) { - $lbl_marital = t(' Status:'); - $marital = $a->profile['marital']; + if($a->profile['with']) $profile['marital']['with'] = $a->profile['with']; -$o .= <<< EOT -
-
$lbl_marital
-
$marital
-EOT; -if($a->profile['with']) { - $with = $a->profile['with']; - $o .= "
($with)
"; -} -$o .= <<< EOT -
-
-EOT; -} + if($a->profile['sexual']) $profile['sexual'] = array( t('Sexual Preference:'), $a->profile['sexual'] ); -if($a->profile['sexual']) { - $lbl_sexual = t('Sexual Preference:'); - $sexual = $a->profile['sexual']; + if($a->profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) ); -$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['contact'])) $profile['contact'] = array( t('Contact information and Social Networks:'), $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['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['book'])) { - $lbl_book = t('Books, literature:'); -$o .= <<< EOT -
-
$lbl_book
-
-
$txt
-
-
-EOT; -} + if($txt = prepare_text($a->profile['tv'])) $profile['tv'] = array( t('Television:'), $txt); -if($txt = prepare_text($a->profile['tv'])) { - $lbl_tv = t('Television:'); -$o .= <<< EOT -
-
$lbl_tv
-
-
$txt
-
-
-EOT; -} + if($txt = prepare_text($a->profile['film'])) $profile['film'] = array( t('Film/dance/culture/entertainment:'), $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['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['romance'])) { - $lbl_romance = t('Love/Romance:'); -$o .= <<< EOT -
-
$lbl_romance
-
-
$txt
-
-
-EOT; -} + if($txt = prepare_text($a->profile['education'])) $profile['education'] = array( t('School/education:'), $txt ); + } -if($txt = prepare_text($a->profile['work'])) { - $lbl_work = t('Work/employment:'); -$o .= <<< EOT -
-
$lbl_work
-
-
$txt
-
-
-EOT; -} + + return replace_macros($tpl, array( + '$title' => t('Profile'), + '$profile' => $profile, + )); -if($txt = prepare_text($a->profile['education'])) { - $lbl_education = t('School/education:'); -$o .= <<< EOT -
-
$lbl_education
-
-
$txt
-
-
-EOT; -} -return $o; }