[pmwiki-users] Adding/subtracting days to ftime Page Text Variable

Stef stefct4 at gmail.com
Fri Sep 5 06:31:31 CDT 2014


2014-09-05 12:47 GMT+02:00, kirpi at kirpi.it <kirpi at kirpi.it>:

>   MyDate:2007-01-02
>
>   NewDate: (:html:)<?php echo date ( 'Y-m-j' , strtotime('-2 days',
> strtotime ('(:htmlend:){$:MyDate}(:html:)') ) );?>(:htmlend:)
>
> Although enabling php is not advisable, it could work. And it does
> work if I write the real date instead of the variable.
> Yet I couldn't find a way to let php understand the value of {$:MyDate}
>

Generally, you can access page text variables in PHP with the PageVar function.
Example:

PageVar($pagename,'$:City')

More information: http://www.pmwiki.org/wiki/PmWiki/PageTextVariables

Not sure whether this would work within PmWiki markup though.

--StefCT



More information about the pmwiki-users mailing list