|
||||||
|
Views:
17,131,572 |
![]() ![]() ![]()
Main
| FAQ
| IRC chat
| Memberlist
| Active users
| Latest posts
| Stats
| Ranks
| Online users
| Search
|
02-18-26 10:50 PM |
||||
| Guest: Register | Login | ||||||
| 0 users currently in AcmlmBoard Developer Zone | 1 bot |
| Main - AcmlmBoard Developer Zone - profile.php user age calculation |
| Arisotura |
| ||
|
Developer
pancakes Level: 85 Posts: 702/1874 EXP: 5826480 Next: 72060 Since: 01-05-12 From: France Last post: 115 days Last view: 54 days |
Turns out that the method used by AB2.5 yields wrong results (one year off) if the user is old enough.
'Old enough' is typically 100 years or more so it doesn't really matter, though. I came up with a different method for calculating the member's age. It works fine for all ages, and as a bonus, it doesn't have the requirement of the code that is implemented currently.
This assumes that the user birthday is stored as 'MM-DD-YYYY' or 'MM-DD' when the year is omitted. ____________________ Kuribo64 - melonDS want some revolution in your coffee? |
| Squiddy |
| ||
|
Banned
Unspecificed Cooling Off Period. Be Safe Bisexual Empress of the Stolen Title? Level: 146 Posts: 5789/6751 EXP: 37620184 Next: 893110 Since: 07-17-13 Last post: 3871 days Last view: 3779 days |
All birthdays in the database that are stored as "-1" will need to be changed to "0" and editprofile.php all also need to be updated to enter 0 instead of -1. This is not a criticism, I'm just stating what needs to be done in conjunction with the new age calculation.
Great job! ![]() ____________________ Sunshine Realm Welcome to Aqmlm's, the only board with Al-Aq'mlmistrators! |
| Arisotura |
| ||
|
Developer
pancakes Level: 85 Posts: 703/1874 EXP: 5826480 Next: 72060 Since: 01-05-12 From: France Last post: 115 days Last view: 54 days |
| Main - AcmlmBoard Developer Zone - profile.php user age calculation |
Acmlmboard v2.5.6 (06/11/2024) © 2005-2026 Acmlm, Emuz, et al. |
|
MySQL - queries: 66, rows: 480/513, time: 0.244 seconds. |