Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Using php: show articles with soon date
I think both our solutions don’t work. Mine is wrong because it still uses the year, yours breaks around new year. See my previous post for a possible solution.
Offline
Re: Using php: show articles with soon date
ruud wrote:
I think both our solutions don’t work. Mine is wrong because it still uses the year, yours breaks around new year. See my previous post for a possible solution.
? Mine is working 100%. I’ve just installed it to my site. May be the task was not clearly? I have to warn about forthcomming bithday dates. In my method i count the differense from the start of year for current day and day, when article was posted. Tha date article was posted is birthday :)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: Using php: show articles with soon date
What happens if a birthday is on january 2nd (day of year = 2) and the current date is december 25th (day of year = 360 or close to that). The calculated diff = 2 – 360 = -358, which is outside the range of 0 < diff < 140 which you use… but in reality jan 2nd is just a week later than dec 25th, so you do want the birthday to display.
Offline
Re: Using php: show articles with soon date
ruud wrote:
What happens if a birthday is on january 2nd (day of year = 2) and the current date is december 25th (day of year = 360 or close to that). The calculated diff = 2 – 360 = -358, which is outside the range of 0 < diff < 140 which you use… but in reality jan 2nd is just a week later than dec 25th, so you do want the birthday to display.
Nice bug – it seems to to null days count… I have to think over this :) Thanks!
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline