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 /include/channel.php | |
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
Diffstat (limited to 'include/channel.php')
-rw-r--r-- | include/channel.php | 25 |
1 files changed, 25 insertions, 0 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'); |