halo! i'd posted a question here http://drupal.org/node/75598 but doesn't seems to get any attention at all.

here's my issue. i customized my drupal profile page with user-profile.tpl.php file. on that file, i placed a snippet so that it will show the user's birthdate.. and it works.

$converted_date = convert_profile_date($account->profile_birth); print date('j F, Y', $converted_date);

my problem is, with cck.module & birthdays.module

1) users are able to set their year of birth to be hidden or not.
2) users can also hide their birthdate

so now, with a php snippet, how can i display or hide the date according to the user's settings?

Comments

davidbessler’s picture

Your code does not work for me. It gives me a blank page. Can someone tell me how to include the users birthday on user-profile.tpl.php in a way that respects users hiding their birthdays? Right now I'm doing it in the most ridiculous way.


 if($account->profile_birthday){

   $month_number = $account->profile_birthday[month];
   $month_name = date( 'F', mktime(0, 0, 0, $month_number) );

   $day_number = $account->profile_birthday[day];
   $day_name = date( 'jS', mktime(0, 0, 0, 0, $day_number) );

   $birthday= $month_name.' '.$day_name;
   print '<b>'.$birthday.'</b>';

}

Niklas Fiekas’s picture

Status: Active » Postponed (maintainer needs more info)

Much has changed in D7. Now you can just render() on the field.

Any updates? Still need this for D6?