[pmwiki-users] fox: summ fields

noskule noskule at gmx.net
Tue Jun 10 08:31:12 CDT 2008


Hans schrieb:
> Sunday, June 8, 2008, 5:32:27 PM, noskule wrote:
>
>   
>> What's the best way to sum fields together?
>>     [input publish-date] [input publish-hours] [input publish-minutes]
>>     
>
>   
>> I would like to sum the tree fields together and save it as "publish-date".
>>     
>
>   
>> Theoretically  I could do it with a foxfilter, but I don't want to store
>> the "hours" and "minute" values.
>>     
>
> if you just want to string-together 
I actually want to calculate tree form field values together.

(:input text date:)
(:input text hours:)
(:input text minutes:)
(:input hidden PublishDate:)

then I sum them together
{(strtotime {$$date})} + {$$hours}*3600 + {$$minutes}*60

and want to save them as unixtime to "PublishDate" ptv.

In the doc I did see that you inplemented functionality to use markup 
expressions in replacement-variables. So I was looking for a way I maybe 
could use it to to manipulate the field value, respectively do the 
calculation above and save the result as "PublishDate"

Do you have any suggestions how to do this?
grz nos


> the input value strings into one
> output string (i.e. no conversion to a unix time stamp), you could
> try in the form:
>
> (:input text publish_date:)
> (:input text publish_hours:)
> (:input text publish_minutes:)
> (:input hidden publish_long_date "{$$publish_date} {$$publish_hours}:{$$publish_minutes}":)
>
> and use {$$publish_long_date} in your template.
>
> Or use the three components separately in your template, like I've
> done in the hidden input field.
>
>   ~Hans
>
>   




More information about the pmwiki-users mailing list