Members Anniversary

Permalink
Hello!

Is it possible to build a block or page to display the members upcoming anniversaries, for the next week or so? If so, how?

Thanks for any input.

rubencouto
 
mkly replied on at Permalink Reply
mkly
To get you started you should be able to calculate if the signup is within a week with something like this
// Get a UserInfo object by id, username etc
$ui = UserInfo::getByID(1);
$year = 31557600; // year in seconds
$week = 604800; // week in seconds
$signup = $ui->getUserDateAdded('system', 'U'); // signup in seconds since Unix epoch
$hasUpcomingAniversary = abs($year - $signup) % $signup > $week); // use the modulo operator to get the remainder and make sure it's less than one week


Didn't really test that but should probably work.

Regards,
Mike
http://mkly.io
rubencouto replied on at Permalink Reply
rubencouto
Hello mkly!

Thanks for the prompt reply!
But I was thinking about the actual anniversaries (real life date of birthdays) of members and not their anniversaries from signup...