You are here

function _birthdays_show_age in Birthdays 5

Same name and namespace in other branches
  1. 6 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()
theme_birthdays_block in ./birthdays.module
Theme function of the blocks
theme_birthdays_page in ./birthdays.module
@desc Theme a birthdays page

File

./birthdays.module, line 1442
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;
}