[pmwiki-users] Help with replacing text

ABClf languefrancaise at gmail.com
Mon Sep 17 13:33:20 CDT 2012

If the date you want to add is just the date the page was created,
just use this snippet
(from http://www.pmwiki.org/wiki/PmWiki/PageVariables) :

Is there a variable like $LastModified, but which shows me the creation time?

No, but you can create one in config.php. For instance:
# add page variable {$PageCreationDate} in format yyyy-mm-dd
$FmtPV['$PageCreationDate'] = 'strftime("%Y-%m-%d", $page["ctime"])';
If you like the same format that you define in config.php with $TimeFmt use
 $FmtPV['$Created'] = "strftime(\$GLOBALS['TimeFmt'], \$page['ctime'])";


2012/9/17 Ian MacGregor <ardchoille42 at gmail.com>:
> I add the date to all of the pages I create. So, what I have done is added
> the following line to my Site.NewPageTemplate:
> %color=#595959% [-mmmm dd, yyyy-]%%
> This works perfectly except that I have to edit the mmmm dd, yyyy each time
> I create a new page. It's not that much work but I was wondering if I could
> automate it a bit.
> What I was thinking about was using $ROSPatterns to add the current date
> when I open the page for editing.
> I thought I would add the following line to the Site.NewPageTemplate:
> %color=#595959% [-monthdayyear-]%%
> and have the wiki convert that to:
> %color=#595959% [-September 17, 2012-]%%
> when I tried editing the page so I wouldn't have to add the current date. I
> tried some ROSPatterns but I got errors and couldn't figure it out on my
> own.
> Am I on the right track here? Any and all advice is appreciated.
> --
> Regards,
> Ian MacGregor
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users


| A | de la langue française
| B | http://www.languefrancaise.net/
| C | languefrancaise at gmail.com

More information about the pmwiki-users mailing list