]> git.mxchange.org Git - friendica.git/blob - include/profile_advanced.php
Merge pull request #1703 from rabuzarus/readable_bytes
[friendica.git] / include / profile_advanced.php
1 <?php
2
3 function advanced_profile(&$a) {
4
5         $o = '';
6
7         $o .= replace_macros(get_markup_template("section_title.tpl"),array(
8                 '$title' => t('Profile')
9         ));
10
11         if($a->profile['name']) {
12
13                 $tpl = get_markup_template('profile_advanced.tpl');
14                 
15                 $profile = array();
16                 
17                 $profile['fullname'] = array( t('Full Name:'), $a->profile['name'] ) ;
18                 
19                 if($a->profile['gender']) $profile['gender'] = array( t('Gender:'),  $a->profile['gender'] );
20                 
21
22                 if(($a->profile['dob']) && ($a->profile['dob'] != '0000-00-00')) {
23                 
24                         $year_bd_format = t('j F, Y');
25                         $short_bd_format = t('j F');
26
27                 
28                         $val = ((intval($a->profile['dob'])) 
29                                 ? day_translate(datetime_convert('UTC','UTC',$a->profile['dob'] . ' 00:00 +00:00',$year_bd_format))
30                                 : day_translate(datetime_convert('UTC','UTC','2001-' . substr($a->profile['dob'],5) . ' 00:00 +00:00',$short_bd_format)));
31
32                         $profile['birthday'] = array( t('Birthday:'), $val);
33
34                 }
35
36                 if($age = age($a->profile['dob'],$a->profile['timezone'],''))  $profile['age'] = array( t('Age:'), $age );
37                         
38
39                 if($a->profile['marital']) $profile['marital'] = array( t('Status:'), $a->profile['marital']);
40
41
42                 if($a->profile['with']) $profile['marital']['with'] = $a->profile['with'];
43
44                 if(strlen($a->profile['howlong']) && $a->profile['howlong'] !== '0000-00-00 00:00:00') {
45                                 $profile['howlong'] = relative_date($a->profile['howlong'], t('for %1$d %2$s'));
46                 }
47
48                 if($a->profile['sexual']) $profile['sexual'] = array( t('Sexual Preference:'), $a->profile['sexual'] );
49
50                 if($a->profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) );
51
52                 if($a->profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify($a->profile['hometown']) );
53
54                 if($a->profile['pub_keywords']) $profile['pub_keywords'] = array( t('Tags:'), $a->profile['pub_keywords']);
55
56                 if($a->profile['politic']) $profile['politic'] = array( t('Political Views:'), $a->profile['politic']);
57
58                 if($a->profile['religion']) $profile['religion'] = array( t('Religion:'), $a->profile['religion']);
59
60                 if($txt = prepare_text($a->profile['about'])) $profile['about'] = array( t('About:'), $txt );
61
62                 if($txt = prepare_text($a->profile['interest'])) $profile['interest'] = array( t('Hobbies/Interests:'), $txt);
63
64                 if($txt = prepare_text($a->profile['likes'])) $profile['likes'] = array( t('Likes:'), $txt);
65
66                 if($txt = prepare_text($a->profile['dislikes'])) $profile['dislikes'] = array( t('Dislikes:'), $txt);
67
68
69                 if($txt = prepare_text($a->profile['contact'])) $profile['contact'] = array( t('Contact information and Social Networks:'), $txt);
70
71                 if($txt = prepare_text($a->profile['music'])) $profile['music'] = array( t('Musical interests:'), $txt);
72                 
73                 if($txt = prepare_text($a->profile['book'])) $profile['book'] = array( t('Books, literature:'), $txt);
74
75                 if($txt = prepare_text($a->profile['tv'])) $profile['tv'] = array( t('Television:'), $txt);
76
77                 if($txt = prepare_text($a->profile['film'])) $profile['film'] = array( t('Film/dance/culture/entertainment:'), $txt);
78
79                 if($txt = prepare_text($a->profile['romance'])) $profile['romance'] = array( t('Love/Romance:'), $txt);
80                 
81                 if($txt = prepare_text($a->profile['work'])) $profile['work'] = array( t('Work/employment:'), $txt);
82
83                 if($txt = prepare_text($a->profile['education'])) $profile['education'] = array( t('School/education:'), $txt );
84                 
85                 if ($a->profile['uid'] == local_user())
86                         $profile['edit'] = array($a->get_baseurl(). '/profiles/'.$a->profile['id'], t('Edit profile'),"", t('Edit profile'));
87                 
88                 return replace_macros($tpl, array(
89                         '$title' => t('Profile'),
90                         '$profile' => $profile
91                 ));
92         }
93
94         return '';
95 }