Module: Birthdays
Posted by Steve H
|
Re: Module: Birthdays February 12, 2008 01:23PM |
Admin Registered: 21 years ago Posts: 8,532 |
Such array would not be accessible from the search function. There are quite some options for working with custom profile fields, but serialized data isn't easily accessible and for sure not by SQL. Therefore if you want data to be searchable, then you can't use array data (as you already found out).
An option would be to use more than one field. Of course I was stupid with YYYYMMDD :-) So instead of one field, you could split it in a YYYY field and a MMDD field. An extreme option would be to create a table for the birthdays storage. For some applications, custom tables might even be needed, because custom fields just don't deliver the goods. But for this typical application, I think that working with custom fields should be sufficient.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
An option would be to use more than one field. Of course I was stupid with YYYYMMDD :-) So instead of one field, you could split it in a YYYY field and a MMDD field. An extreme option would be to create a table for the birthdays storage. For some applications, custom tables might even be needed, because custom fields just don't deliver the goods. But for this typical application, I think that working with custom fields should be sufficient.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: Module: Birthdays February 12, 2008 06:44PM |
Registered: 18 years ago Posts: 9 |
|
Re: Module: Birthdays February 13, 2008 02:19AM |
Admin Registered: 21 years ago Posts: 8,532 |
I looked at the code and I see that the getdate() PHP function is used for working with the date. That is problematic here, since UNIX dates (a.k.a. Epoch) are defined as the number of seconds since Januari 1st 1970. Therefore, you can not use dates before that time when using the standard UNIX date processors.
For my own projects, I nowadays use SQL queries for advanced date processing. Most SQL server systems (and MySQL as well) have well written date functions in their library. Of course doing so would make this module MySQL targeted, unless care would be taken to allow multiple db layers (which is not too hard too do; check the spam hurdles module for example).
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
For my own projects, I nowadays use SQL queries for advanced date processing. Most SQL server systems (and MySQL as well) have well written date functions in their library. Of course doing so would make this module MySQL targeted, unless care would be taken to allow multiple db layers (which is not too hard too do; check the spam hurdles module for example).
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: Module: Birthdays February 13, 2008 02:43PM |
Registered: 22 years ago Posts: 238 |
I have set birthdays prior to 1969 with this module, and it worked fine. While it certainly sounds like Jan-Willem is having a problem with the UNIX date, it isn't a universal problem. Perhaps something different in his installation?
At any rate, once I rewrite the module to store YYYY and MMDD the UNIX timestamp issue will go away.
...
Steve H, currently on: (version 5.2.23)
contributions:
Birthdays mod, Top Users mod, Icon legend.tpl, (plus a handful of bugfixes and old 5.0 creations)
At any rate, once I rewrite the module to store YYYY and MMDD the UNIX timestamp issue will go away.
...
Steve H, currently on: (version 5.2.23)
contributions:
Birthdays mod, Top Users mod, Icon legend.tpl, (plus a handful of bugfixes and old 5.0 creations)
|
Re: Module: Birthdays February 13, 2008 04:17PM |
Registered: 18 years ago Posts: 35 |
|
Re: Module: Birthdays February 13, 2008 05:25PM |
Registered: 18 years ago Posts: 9 |
|
Re: Module: Birthdays April 02, 2008 07:20AM |
Registered: 19 years ago Posts: 56 |
|
Re: Module: Birthdays April 06, 2008 08:16AM |
Registered: 18 years ago Posts: 1 |
|
Re: Module: Birthdays April 07, 2008 11:42AM |
Registered: 19 years ago Posts: 56 |
Quote
Sunbringer
Somehow the Birthdays today are not shown. The Birthdays in die Future are working fine, but not the actual birthdays today.
Any hints for that problem?
OK, problem solved: the mod didn't recognise that 2008 is a leap year so this little hack shouldt help out:
change
322 if($ubirthday["yday"] >= $jetzt["yday"]) 323 $nextBirthday = mktime(0,0,1,$ubirthday["mon"],$ubirthday["mday"],$jetzt["year"]); 324 else 325 $nextBirthday = mktime(0,0,1,$ubirthday["mon"],$ubirthday["mday"],$jetzt["year"]+1);
to
322 if((date("L", mktime(0,0,1,$jetzt["mon"],$jetzt["mday"],$jetzt["year"])) == 1) || ($ubirthday["yday"] >= $jetzt["yday"]))
323 $nextBirthday = mktime(0,0,1,$ubirthday["mon"],$ubirthday["mday"],$jetzt["year"]);
324 else
325 $nextBirthday = mktime(0,0,1,$ubirthday["mon"],$ubirthday["mday"],$jetzt["year"]+1);
greetings
Sun
|
Re: Module: Birthdays April 26, 2008 07:31PM |
Registered: 21 years ago Posts: 45 |
Sorry, only registered users may post in this forum.

