I have been trying to get the user's date of birth and/or age to show in a custom profile and all the nsippets given on the custom profile support area have only shown the year 2007 instead of the age ofthe user or their actual birth date. I was wondering if anyone could provide me with some code to add to my custom user profile.
Comments
Comment #1
jacauc commentedsubscribing
Comment #2
spyderpie commentedI am looking for a snippet too. - subscribing
Comment #3
demon326 commentedhi,i have the full snippets but there not working
this is the code :
but thats not working it only shows the date of the current day and thats now for what where searching for
i hope somone can help us!
Comment #4
Haggle commentedI think the best way of finding it would be to look for what is printed in the default profile. I'm not as php savy as I'd like to be so I won't be able to find it. The code necessary is probably in the module itself and even marked with a comment of some sort.
Comment #5
spyderpie commented:)
Got it ...
Julie
Comment #6
Haggle commentedThank
Comment #7
maartenvg commentedA new version has been committed, in less than 24 hours you should be able to download it. Please test it for us, instructions are in the README file.
The changes also include a better way to format the birthdays and calculate the age.
To display the birthdate:
To get the age:
Comment #8
maartenvg commentedComment #9
maartenvg commentedGetting the age is even more simple than I remember because the age is saved into the user object on loading:
Comment #10
lvto2000 commentedFROM YOUR README>>>>>>>>>
CUSTOMIZING THE MODULE
----------------------
Sometimes you might want to customize the way some areas of the module look.
For instance, you might want to alter the Birthdays page, or change the listing
in the Birthdays blocks. This can be done by overriding the theme functions.
How to do so can be found here: http://drupal.org/node/173880.
If you want to display the date of birth or age on another location (e.g. near
the username, in the forums, on nodes), you best use the functions
$age = _birthdays_show_age($account);
$date = _birthdays_show_date($date_array, $account, 'medium');
These will adhere to the global or user determined visibility of the age and
year of date.
More specific information might follow later.
>>>>> END OF YOUR README
MY CODE IN A PANELS PHP BLOCK >>>>>>
NOTHING,,, NADDA... Nothing outputs other than the confirmation to me that the echo for "MODULE EXISTS" does fire. Also the "hello" echo fires. Otherwise, the functions dont seem to do anything at all. $age does not echo and neither does $date. I see that the developer changed how this works several times in this thread. Does anyone know if he changed it again? I am using the latest version for Drupal 6.28.
Any help would be appreciated.