function _birthdays_show_age in Birthdays 6
Same name and namespace in other branches
- 5 birthdays.module \_birthdays_show_age()
Return age if user has agreed to show it
Parameters
object $account: a user object having attribute "age" set
Return value
int
2 calls to _birthdays_show_age()
- template_preprocess_birthdays_block in ./
birthdays.module - Preprocess variables to format the birthdays block.
- template_preprocess_birthdays_page in ./
birthdays.page.inc - Preprocess variables to format the birthdays page.
File
- ./
birthdays.module, line 986 - The Birthdays module allows users to add their birthday to their profile. It lists birthdays on a seperate page and in different blocks. Users can receive an e-mail on their birthday automatically, and the administrator can receive daily reminders of…
Code
function _birthdays_show_age($account) {
$age = NULL;
if (isset($account->age) && (variable_get('birthdays_hide_year', BIRTHDAYS_HIDE_YEAR_NO) == BIRTHDAYS_HIDE_YEAR_NO || variable_get('birthdays_hide_year', BIRTHDAYS_HIDE_YEAR_NO) == BIRTHDAYS_HIDE_YEAR_USER && $account->birthdays_user_hide_year != BIRTHDAYS_HIDE_YEAR_USER_YES)) {
$age = $account->age;
}
return $age;
}