Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2007-10-29 18:26:50

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#14 2007-10-29 19:04:33

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

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

#15 2007-10-29 19:11:51

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#16 2007-11-12 19:09:56

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

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

Board footer

Powered by FluxBB