[pmwiki-users] Page Variables help - how to take one and split into two
Hans
design5 at softflow.co.uk
Mon Nov 2 15:30:23 CST 2009
try this:
$FmtPV['$Latitude'] = '@$page["latitude"]';
SaveProperties[] = 'latitude';
FmtPV['$Longitude'] = '@$page["longitude"]';
SaveProperties[] = 'longitude';
Markup('coord', 'directives',
"/\\(:coord\\s+(.*?)\\s+(.*?)\\s*:\\)/ei",
"PZZ(SetCoord(\$pagename, PSS('$1'), PSS('$2')))");
function SetCoord($pagename, $lat, $long) {
SetProperty($pagename, 'latitude', $lat, ', ');
SetProperty($pagename, 'longitude', $long, ', ');
}
This could be improved to allow parameters like
lat=57.5 lon=-130
within the coord markup, by using the ParseArgs() function.
~Hans
More information about the pmwiki-users
mailing list