To dump out blog style content items I’ve told ditto to output them using the parameter
&orderBy=`pub_date DESC`
When I want to insert a new item somewhere in the middle of my existing already published list of items, I thought that would be easy, just by setting an appropriate item published date in the manager interface settings tab (I’m using evolution 1.0.2). As long as that date has already elapsed, it will be automatically published and should appear in the order I want relative to the other items.
Things don’t seem to be working as expected and when looking at the database fields in the content table I noticed there were 2 similar fields, one called ’pub_date’ and the other called ’publishedon’ What is the difference? Looking at the format of the field I thought this was a Unix epoch time field (i.e. seconds since 1st Jan 1970), but when using an epoch converter utility that doesn’t seem to be the case.
What I’m trying to do is insert arbitrary content items on the blog section of a site and frig the apparent date the user sees on the page. That should be easy. Can someone please tell me how to do this?
I’ve also noticed that some of my previously published items, don’t display a published date in the manager settings tab. The check box is ticked for it being published but there is no date shown. I wonder why this is?
pub_date is a future publication date/time. At that time (actually later since someone has to visit the site for MODx to act) the status changes from unpublished to published.
publishedon is the time the resource last changed from unpublished to published, either because of pub_date, or a Manager user manually publishing the resource.
IIRC, both are unix timestamps in the DB, but are converted to strings when you render them with a resource tag or (in Revolution) use get() to retrieve them.
Ok thanks, this clears up a lot of confusion if I understand you right.
So I guess in the manager interface settings tab, ’Published date’ corresponds to the ’pub_date’ database field - and the manager only shows any kind of date if there is a pub_date, which not all already published resources will have.
I think I will use ditto with ’publishedon’ from now on.
Right. Actually, published resources are guaranteed *not* to have a pub_date (Published Date), since it’s wiped out when they are published. Similarly, unpub_date is wiped out when something is unpublished.
BTW, there is also createdon (which doesn’t change) and editedon (set to the time of the most recent save).