Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-08-20 06:54:16

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,473
Website

Change all article dates at first launch?

I’m sure this has been answered before but I can’t seem to dig anything up.

On the glossary project (which has become an ‘almanossary’; a portmanteau of almanac + glossary), I’m using ‘last revised’ dates instead of published dates. I have many articles in various states of draft, so many different publish dates.

When the time comes to launch the site, I’d like to use that date as the initial publish date for all articles ready at that time. This date would be mentioned in the About info as the publish date for all content, and then individual pages would show only the ‘revised’ date over time and editing.

Is there some database way to bulk edit the publish dates to a given time when I’m ready to do so? Admittedly, I haven’t looked into the features of Sequal Pro yet.

Offline

#2 2020-08-20 07:22:17

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,946
Website

Re: Change all article dates at first launch?

Yes, you could do that in one go via the database.

As the last modified and posted date have an identical format in the database, you could run an SQL query (in the sql panel of Sequel Pro or phpmyadmin) to copy to the contents of one column (LastMod) into another (Posted).

UPDATE textpattern SET Posted = LastMod

That changes all articles in Textpattern. If you need to change only certain articles, you may need an SQL query that is more selective.

PS: make a DB backup first. Always a good idea.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2020-08-20 07:54:13

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,473
Website

Re: Change all article dates at first launch?

Okay, a SQL query will be required, then. Good to know.

But I’m going to need the publish dates all the same. Copying the last revised dates to that column won’t help me, because they are variable too.

So I’m guessing I’ll need a query that simply overwrites the publish fields with a constant date value. That should be doable.

Offline

#4 2020-08-20 08:57:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,946
Website

Re: Change all article dates at first launch?

Sorry, I misunderstood you there. Yes, you can do that too:

UPDATE textpattern SET Posted = 'YYYY-MM-DD HH:MM:SS'

You might want to do the same for LastMod too to avoid having LastMod before the Posted date.


TXP Builders – finely-crafted code, design and txp

Offline

#5 2020-08-20 08:59:25

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,473
Website

Re: Change all article dates at first launch?

jakob wrote #325491:

You might want to do the same for LastMod too to avoid having LastMod before the Posted date.

Thank you. And +1 on that point. ;)

Offline

#6 2020-08-20 09:34:01

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 3,176

Re: Change all article dates at first launch?

Destry wrote #325481:

Admittedly, I haven’t looked into the features of Sequal Pro yet.

It’s really good. It’s a bit twitchy with very new versions of MySQL and derivatives, so make sure if you’re running MySQL 8 that you have the nightly (or latest) build to avoid problems.

There’s a fork of the Sequel Pro codebase called Sequel Ace that is also worth a spin, it has fresh energy and regular releases.

Offline

#7 2020-10-15 12:10:42

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,473
Website

Re: Change all article dates at first launch?

gaekwad wrote #325495:

There’s a fork of the Sequel Pro codebase called Sequel Ace that is also worth a spin, it has fresh energy and regular releases.

Just installed it. It keeps crashing ever time I try to open a tab or window.

Moved back to Pro, it opens and works good as ever. I guess I’m in no hurry to switch.

Maybe Ace isn’t catering to macOS High Sierra limitations (per my old mbp). Or maybe you can’t have both installed? Don’t know.

Last edited by Destry (2020-10-15 12:11:27)

Offline

#8 2020-10-15 12:26:09

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 3,176

Re: Change all article dates at first launch?

Destry wrote #326413:

Just installed it. It keeps crashing ever time I try to open a tab or window.

github.com/Sequel-Ace/Sequel-Ace/issues/403

You’re not alone, it seems.

Offline

#9 2020-10-16 07:01:02

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,473
Website

Re: Change all article dates at first launch?

And it did seem to be a High Sierra issue, though they now have it fixed, apparently.

Offline

#10 2020-10-16 08:02:59

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,145
Website

Re: Change all article dates at first launch?

A fixed build is now available on the Mac App store, it this is where you fetch your build.


Where is that emoji for a solar powered submarine when you need it ?

Offline

Board footer

Powered by FluxBB