[pmwiki-users] why does this work ?? ( was : working with page variables )
Américo Albuquerque
aalbuquerque at lanowar.sytes.net
Wed May 17 10:27:31 CDT 2006
Hello
----- Original Message -----
Subject: [pmwiki-users] why does this work ?? ( was : working with page
variables )
Date: Wed, 17 May 2006 12:42:51 +0200
From: Marco Ferretti
> Hi all.
> I managed to get to my point . Now I am a little bit confused .
>
> How comes that :
> $FmtPV['$EventDate2'] = 'StripName($pagename)';
> $FmtPV['$EventRealDate'] = 'strftime("%Y-%m-%d",
strtotime($EventDate2)))';
>
> doesn't work and
>
> $FmtPV['$EventRealDate'] = 'strftime("%Y-%m-%d",
> strtotime(StripName($pagename)))';
>
> works ??
In the first case you're using an unitialized variable ($EventDate2) in
your statement. You have to keep in mind that creating a
$FmtPV['$EventDate2'] variable is not the same as creating a
$EventDate2. The same reason why you can't simply use $Group or $Name
variables in PHP.
You can try to use PageVar to get your variable, something like:
$FmtPV['$EventRealDate'] = 'strftime("%Y-%m-%d",
strtotime(PageVar($pagename, \'$EventDate2\')))';
Regards,
Americo ALbuquerque
More information about the pmwiki-users
mailing list