diff options
author | zotlabs <mike@macgirvin.com> | 2017-06-27 21:55:34 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-06-27 21:55:34 -0700 |
commit | 4c50bfebc293554d9c9a4a8c34b929b03c132d68 (patch) | |
tree | 458129d2fceb911a582179c69fc63f72431ab11b | |
parent | dab00a98e0b450183ef5f6ad9d6f4708e2246695 (diff) | |
download | volse-hubzilla-4c50bfebc293554d9c9a4a8c34b929b03c132d68.tar.gz volse-hubzilla-4c50bfebc293554d9c9a4a8c34b929b03c132d68.tar.bz2 volse-hubzilla-4c50bfebc293554d9c9a4a8c34b929b03c132d68.zip |
provide a gender icon on the profile sidebar within reason
-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}} |