[pmwiki-users] Amending ctime from Within PmWiki
Patrick R. Michaud
pmichaud at pobox.com
Wed Jul 19 12:27:25 CDT 2006
On Wed, Jul 19, 2006 at 12:16:29PM -0500, Jon Haupt wrote:
> It still seems like the best option would be creating a new page attribute
> and making it editable using ?action=attr; I think this had been mentioned
> in the blogging discussion before. This would allow you to change the
> ctime of any page that already exists without going in and editing the
> file in wiki.d and converting unix times...
>
> How difficult is it to implement something like that?
It's easy to add ctime to ?action=attr, the hard part is having
something that can convert dates and times into unix timestamps.
(Especially since whatever we use needs to be re-usable for many
date+time conversions in PmWiki, not just this one application.)
To just add ctime to ?action=attr:
$PageAttributes['ctime'] = '$[Set page creation time:]';
This at least allows a person to enter a new timestamp, but
it doesn't handle conversions well (I'm still thinking about
that issue). One simplistic way to do that might be to do the
following in local/config.php or a recipe:
if (@$_POST['ctime']) { ...code to convert ctime here... }
Of course, one could always create an ?action=ctime that allows
the ctime to be set directly (and defaults to requiring 'attr'
permission), thus
.../pmwiki.php?n=Main.SomePage?action=ctime?when=2006-07-18
could be used to change a page's ctime to a different date
without having to go through a form. More likely would be
to come up with an extensible form of ?action=postattr,
which given things like:
.../pmwiki.php?n=Main.SomePage?action=postattr&ctime=2006-07-18
.../pmwiki.php?n=Main.SomePage?action=postattr&time=2006-07-18
.../pmwiki.php?n=Main.SomePage?action=postattr&title=....
would be able to call special "hooks" for each attribute to
be set.
Pm
More information about the pmwiki-users
mailing list