diff options
-rw-r--r-- | include/channel.php | 25 | ||||
-rwxr-xr-x | view/tpl/profile_vcard.tpl | 2 |
2 files changed, 26 insertions, 1 deletions
diff --git a/include/channel.php b/include/channel.php index 25e54003a..a6b510600 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1162,6 +1162,10 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = fa $location = $reddress = $pdesc = $gender = $marital = $homepage = False; } + if($profile['gender']) { + $profile['gender_icon'] = gender_icon($profile['gender']); + } + $firstname = ((strpos($profile['channel_name'],' ')) ? trim(substr($profile['channel_name'],0,strpos($profile['channel_name'],' '))) : $profile['channel_name']); $lastname = (($firstname === $profile['channel_name']) ? '' : trim(substr($profile['channel_name'],strlen($firstname)))); @@ -1214,6 +1218,27 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = fa } +function gender_icon($gender) { + + logger('gender: ' . $gender); + + // This can easily get throw off if the observer language is different + // than the channel owner language. + + if(strpos(strtolower($gender),strtolower(t('Female'))) !== false) + return 'venus'; + if(strpos(strtolower($gender),strtolower(t('Male'))) !== false) + return 'mars'; + if(strpos(strtolower($gender),strtolower(t('Trans'))) !== false) + return 'transgender'; + if(strpos(strtolower($gender),strtolower(t('Neuter'))) !== false) + return 'neuter'; + if(strpos(strtolower($gender),strtolower(t('Non-specific'))) !== false) + return 'genderless'; + + return ''; +} + function advanced_profile(&$a) { require_once('include/text.php'); diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl index c17a7878c..13c22a2c7 100755 --- a/view/tpl/profile_vcard.tpl +++ b/view/tpl/profile_vcard.tpl @@ -43,7 +43,7 @@ </dl> {{/if}} - {{if $gender}}<dl class="mf"><dt class="gender-label">{{$gender}}</dt> <dd class="p-gender">{{$profile.gender}}</dd></dl>{{/if}} + {{if $gender}}<dl class="mf"><dt class="gender-label">{{$gender}}</dt> <dd class="p-gender">{{if $profile.gender_icon}}<i class="fa fa-{{$profile.gender_icon}}"></i> {{/if}}{{$profile.gender}}</dd></dl>{{/if}} {{if $marital}}<dl class="marital"><dt class="marital-label"><span class="heart"><i class="fa fa-heart"></i> </span>{{$marital}}</dt><dd class="marital-text">{{$profile.marital}}</dd></dl>{{/if}} |