FAQ: How to update posts without making their date change?
March 15, 2006.     Axel Beckert

On the MailingList, a frequently asked question is, how to prevent that a posting moves to the top of the blog because with a modification (e.g. a fixed typo) the modification date of the file changed and blosxom uses this file as the posting date.

This article shall outline the solutions to this problem, which were suggest in the thread started with this mail on the MailingList.

There are at least three different concepts to solve this problem:

  • Letting blosxom remember when it first saw this posting and let it keep that date by using a plugin.
  • Setting the date through meta data inside the article or the article's file name and let a plugin tell blosxom that date.
  • Setting the date through meta data inside the article or the article's file name and ressetting the file modification date after changes based on that data manually or by a manually called, local (shell) script.

We will focus on the first two concepts here.

The oldest and some kind of a no-frills plugin to preserve the posting time automatically is Rael's entries_index which caches the file modification time when it first notices a posting.

The plugin entriescache is based on entries_index and offers the same functionality, but also caches all story data for a configurable number of minutes and therefore reduces the number of accessing all posts on the harddisk to one access all few minutes.

Both plugins are also available in a variant which lets you set the time by including it as a meta tag into the post file: The plugin entries_index_tagged works like and is based on the entries_index plugin but allows to include date and time information in the Unix time stamp format (seconds since Jan 1st, 1970 00:00:00 GMT). You should install the meta plugin, too, to make this plugin work as expected.

The caching variant is the plugin entries_cache_meta. It has some more features, so it accepts at least one much more human readable date format thanthe Unix times stamp format and — if the Perl module Date::Parse is installed — all formats that module can parse.

Click the button to

 

R. Francis Smith wrote
2006/3/18 17:26:15
simpler if bruteforce
Hi, I just returned to blosxom to do my podcast sites after quite a while of being absent from the blosxom world. (Wordpress made me...angry. Anyway.) While being aware of the various plugin routes to trying to handle dates, I have to admit that so far I've gone for something more straightforward on the linux servers I use. I simply do "touch -f <file> /tmp/tmp; vi <file>; touch -f /tmp/tmp <file>" and all is well. I will doubtless alias this at some point. Obviously this doesn't help people who are ftping up their files or whatever, but for what it's worth, this is what I do. -R
R. Francis Smith wrote
2006/3/18 17:53:15
oops
Even better, you could use touch -r, which does what I meant, not touch -f, which doesn't. :) -R
Donut wrote
2006/3/22 09:34:16

Is there someway of defining the post order by the file date? For example - If i create files called post1_010106.txt, post1_020106.txt, post1_120106.txt etc the latest, post1_120106.txt would be listed first and would never change even after additional changes to the file.
Douglas Nerad wrote
2006/3/22 12:16:53
permtimez
Hey Donut, it looks like you might be interested in Stu MacKenzie's <code>permtimez</code> plugin, available here and in the local plugin repository. It works based on a date placed in the filename.
becky wrote
2006/5/28 14:57:17
a little more guidance..
Hi there, I think the "entries_index_tagged" and "meta" plugin combo is going to be the solution for me. However, I'm not much of a programmer and I'm a little lost at how to get these plugins to work. For example, I'm unclear on where the meta date tag should appear in my entries, and what it should look like. I have no idea what a Unix time stamp format should look like, either. If someone could take a moment and post a mini-walkthrough on configuration and formatting, I'd be eternally grateful. Sorry about my lack of knowledge! If you believe I shouldn't be messing on this level with Blosxom without CGI experience, then please suggest a more user-friendly blog app. I like Blosxom a lot, but this date-change issue is a big problem for me. --Becky [designer not programmer]