Re: hardcoding mtimes for stories in their metadata section
Dieter Plaetinck <dieter-7FYLOmueu/[email protected]> Mon, 1 Nov 2010 15:32:58 +0100
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 1 Nov 2010 10:21:14 -0400 Tim Gray <tgray-kfNaf1zyJtt8UrSeD/[email protected]> wrote: > On Nov 01, 2010 at 03:11 PM +0100, Dieter Plaetinck wrote: > > Thanks, this is actually another plugin then the one I was looking > > for. > > Yeah I wrote this from scratch the other month. > > > Notice that both the description for cb_prepare as well as the big > > comment block on top of your file imply that they reset/ignore mtime > > first, and then update using the info from the metadata. This is > > not correct, from looking at the code it seems that the pubdate can > > override the mtime, but the mtime is not discarded if there is no > > pubdate. > > That is correct. If there is not pubdate/pubtime, then the file's > mtime is used. If I recall correctly, the if those variables aren't > set in the post file, $(pubtime), $(pubdate), $(displaytime), and > $(displaydate) are all populated by the file's mtime, so you can use > the same set of templates and mix files with hardcoded dates and > files with mtime encoded dates. > > I think cb_prepare's comment reflects that fact that during the > cb_sortlist loop (which occurs before), a file's pubtime is set > according to the mtime if #pubtime/#pubdate doesn't exist. So once > you get to cb_prepare, we DO ignore file's actual mtime - it's > already been taking into account. hmmm.. okay. anyway, just tried your plugin, and it seems to works nicely. What would be pretty cool, is if the pubdate is in the future, don't show the story. this would allow me to time precisely when i want to publish a story at some point in the future. Dieter ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev