Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
<txp:file_download_modified /> date stuck?
Hi TXPers,
I am using in a files form, updated: <txp:file_download_modified format="%a %e %b
%l:%m %p” />@
This seems to return the date/time the file was added, lovely, but not reflect a new date when I replace the file with an updated version, even if I tick Set timestamp to now…
I’ve searched here and outside and as far as I can see, this is the correct tag and the correct use, but it seems to be being ignored.
Any clues, most appreciated.
Cheers, -Alan
At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A
Offline
#2 2010-09-02 19:55:57
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: <txp:file_download_modified /> date stuck?
I seem to remember that the modified date is picked up from the file itself, not from the database. If you want to show the date the file was replaced you need to set the timestamp to now and use file_download_created.
Someone correct me if I’m wrong.
Edit: let me correct myself… I found this old forum post which appears to confirm what I originally said, but I just tried to do what you described, Alan, and the file_download_modified tag displays the new date just fine if I reset the timestamp.
Edit again: tested again because I realised I replaced it with a completely different file, and you’re right, the modified date doesn’t change when you upload a modified version of the original file…
Last edited by els (2010-09-02 20:13:21)
Offline
Re: <txp:file_download_modified /> date stuck?
Els, I am in your debt once again, it was browser cache — my only excuse is that I did of course reload the page several times, but I didn’t clear the cache — I assumed the refresh would force the page to re-read the db and hence if all was working, the new date would show.
I guess the behaviour I am seeing is helpful from a speed and not wanting to hurt your db too hard point of view, a good thing.
Again, thanks so much!
Cheers, -Alan
At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A
Offline
#4 2010-09-02 20:22:05
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: <txp:file_download_modified /> date stuck?
Hey Alan, I think I edited my post while you were writing, clearing the cache doesn’t help me …
Offline
Re: <txp:file_download_modified /> date stuck?
Hi Els,
What!!??? Now I am completely confused! :D
Oh dear. It seems to work for me. Specifically I opened a different browser, killed all history, cache, . ;) and opened the page and it showed the new date.
Confusing — if I can help by telling you my code (but it’s just easy stuff) just say.
At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A
Offline
#6 2010-09-02 20:43:06
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: <txp:file_download_modified /> date stuck?
Well, I’m even more confused than you ;) I can’t get the tag to display a new modified date at all anymore, not even in a different browser, no matter if I replace the file with a modified version or with a completely different file… So why did it work the first time? Search me.
Ah well, I don’t need it, and I’m glad it works for you :)
Offline
Re: <txp:file_download_modified /> date stuck?
Eek! =:-\
How weird. I assume you clicked the reset timestamp and then saved…
Glad you don’t need it so it’s not a problem for you — a weird Thursday problem for sure :)
At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A
Offline