Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 06 Apr 2008, 12:30
arkkhoax arkkhoax is offline
 
Join Date: Jun 2006
Code to output users age based on birthdate

This is most likely very simple and easy to do but I can't figure out how to output the users age in vbulletin based on their registration birth date. There does not seem to be a variable built in for it. Any help would be appreciated.

Thanks.

--------------- Added 06 Apr 2008 at 23:28 ---------------

I think all the code needs to do is subtract the birth date year from the current year to get the age. Could anyone help me?

--------------- Added 07 Apr 2008 at 00:44 ---------------

Oh, after much hunting and pulling my hair out I figured out how to get the age of the user. Hope other people searching around find this of help.

The variable that holds the birthdate is $vbulletin->userinfo['birthday']

To then turn it into an age I used this function.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Last edited by arkkhoax; 07 Apr 2008 at 00:44. Reason: Auto-Merged DoublePost
Reply With Quote
  #2  
Old 07 Apr 2008, 01:46
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Showing a user's age is already a feature. However, many members disable it for various reasons.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 16:01.

Layout Options | Width: Wide Color: