Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-03-14 19:29:56

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

now() and future articles

This is more an observation than help request. I am using article_custom to show a list of articles with a publish date set in the future. Sometimes there aren’t any such articles in that section. In that case I gather that now() (txplib_db.php 1592 in 4.8.0) defaults to a hard-coded timestamp set well into the future.

This had me puzzled after posting some articles on a local server, then importing them to the live server. On the local server, the future articles show up as expected. No go on the live site. The query on the live site is using that hard-coded timestamp (2147483647), I guess because it is using a cached query, and until I added these articles, there were no future articles. On this server I don’t have privileges to flush tables, so I’m waiting to see how long it takes to clear.

I note that the comment block for now() says the function should only be used when comparing Posted or Expired from the textpattern table, but I think it is being used in this case also.


Code is topiary

Offline

#2 2020-03-15 10:02:35

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: now() and future articles

I’m using such a kind of display with article_custom for articles set in the future and filtered by expiration dates, too. I didn’t encour any problems but I remember the use of time attribute (as explain into the official doc) for good rendering (otherwise I’d got some mischmaks).


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#3 2020-03-15 11:31:01

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: now() and future articles

Thanks Patrick, I’m using the time attribute for this. The little issue I was having wasn’t incorrect or a bug per se, but an unexpected side effect of this hard-coded timestamp combined with query caching on the server.

Fortunately, the cache has cleared now.


Code is topiary

Offline

Board footer

Powered by FluxBB