Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2025-11-12 00:15:28

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,266
Website Mastodon

changing image Date added

I have not been able to find where changing the date added for an uploaded image can have it’s date added changed so that it appears after the latest added.
At the moment once an image has been added it gets outputted by ID number and in order of the date added. I want the id to remain as is, it is being used in an article, but I would like for the image to appear in a different order based on the upload date. I want my latest image to appear ahead of the one I loaded previously. As far as I can tell the order is performed by date/time. or is there another way that I am missing..


…. texted postive

Online

#2 2025-11-12 20:12:03

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

Re: changing image Date added

This looks inconsistent with other data types, indeed. Is there any reason to forbid the publish date modification for images?

Offline

#3 2025-11-12 20:16:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: changing image Date added

Not as far as I can see. Seems like a logical addition to the sidebar.

The only thing that makes it slightly tricky is that would then allow images to be given future dates so the <txp:images>tag would need to be able to pull out time="past|future|all", I guess.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#4 2025-11-12 20:57:31

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

Re: changing image Date added

The time thing done. Would you mind patching the admin side ?;-)

Offline

#5 2025-11-12 21:07:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: changing image Date added

Sure. I’ll do it tonight. Nice one.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#6 2025-11-12 22:29:02

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,266
Website Mastodon

Re: changing image Date added

etc wrote #341160:

The time thing done. Would you mind patching the admin side ?;-)

Skookum! .. thanks


…. texted postive

Online

#7 2025-11-13 12:08:47

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

Re: changing image Date added

While I was at it, I have added exclude attribute to <txp:file_download_list /> and <txp:linklist /> tags, and also refactored auto_detect feature, for more consistency/flexibility. Seems to work in my loose tests, but the more eyes the better.

Offline

#8 2025-11-13 14:50:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: changing image Date added

Nice! I did the admin changes last night but want to do a few more tests first.

One that confuses me is that the image timestamp is set in the database as, say, 15:45:25 Which is the same time as shown on the admin side, but on the front end it shows as 17:45:25 because it’s run through gtime() which takes the locale into account. The server is in Germany and I’m in the UK.

Not sure if there is a way around this or if it’s just as expected.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#9 2025-11-13 22:26:45

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

Re: changing image Date added

Is this the same for articles? I remember having struggled with different tz combinations, but have no distant server at hand to test.

Offline

#10 2025-11-13 23:16:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: changing image Date added

etc wrote #341171:

Is this the same for articles?

Bizarrely, no. The front end Posted time matches the back end Posted time on the article.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#11 2025-11-15 13:29:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: changing image Date added

The latest few commits should have brought image date adjustments to the Image > Edit step, as well as date searching on both the Images and Files panels. Please test, especially since there may be timezone weirdness in play that I haven’t tracked down yet.

Last edited by Bloke (2025-11-15 13:30:06)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#12 2025-11-15 14:55:52

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

Re: changing image Date added

Nice one, I hope our world-wide users will find time to test it before 4.9 release.

Could date input be put immediately after the image name (and before the category), for consistency with articles?

Offline

#13 2025-11-15 14:59:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: changing image Date added

etc wrote #341183:

Could date input be put immediately after the image name (and before the category), for consistency with articles?

We could. I only put it down there because I deem it not as important as alt and caption. Will take the consensus.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#14 2025-11-16 02:42:08

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,664
Website

Re: changing image Date added

I’d go for consistency with the Files panel, where the data (Published) comes after the description.

BTW – did I test it correctly, I can change the data (now, future or past) but only back to 1970-something, not ealier ?

I had that faint hope to inout the real date for the image (e.g creation, copyright) and get rid of my date custom-field – e.g images that have been created between 1923-28…, looks like I am out of luck there.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#15 2025-11-16 07:16:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: changing image Date added

Better date handling is something I’d like to be able to offer but I don’t know how to go about it. MySQL can store old dates in the Date field (and by inference DateTime?) but I suspect the fact we convert it to a Unix timestamp for timezone conversion and calculation purposes is scuppering things, as that means it can only go back as far as 1970.

Any thoughts on this, Oleg? It would be nice to be able to offer a more full date range.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB