Computing with Variables

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Computing with Variables

Heinz-Josef Lücking-2
How is it possible to do simple computing with Variables?

I would like to to things like "{{currentday}}+1"

thx. Heinz

_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Computing with Variables

Ivan Krstić-3
Heinz wrote:
> How is it possible to do simple computing with Variables?

It's not, unless you want to hack the parser yourself.

--
Ivan Krstic <[hidden email]> | GPG: 0x147C722D
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Computing with Variables

Minh Nguyen-2
In reply to this post by Heinz-Josef Lücking-2
Heinz wrote:
> How is it possible to do simple computing with Variables?
>
> I would like to to things like "{{currentday}}+1"
>
> thx. Heinz

I had to do something similar with the Vietnamese Wikipedia's weekly
featured article template
<http://vi.wikipedia.org/wiki/Ti%C3%AAu_b%E1%BA%A3n:B%C3%A0i_vi%E1%BA%BFt_ch%E1%BB%8Dn_l%E1%BB%8Dc>.
We used the {{CURRENTWEEK}} variable but I wanted an
automatically-generated list of previous weeks' articles, so I used the
switch template <http://en.wikipedia.org/wiki/Template:Switch> to map
every week to a previous week, then every week to two weeks before, etc.
It's verbose, but it works.

With days, it's slightly more complicated, because each month has a
different number of days, but if you're using that code to call a
particular template or link to some page, then you can use a redirect
from February 31 to March 2, for example, to call the correct template.

--
Minh Nguyen <[hidden email]>
AIM: trycom2000; Jabber: [hidden email]; Blog: http://mxn.f2o.org/

_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Computing with Variables

Heinz-Josef Lücking-2
Minh Nguyen schrieb:

> Heinz wrote:
>> How is it possible to do simple computing with Variables?
>>
>> I would like to to things like "{{currentday}}+1"
>>
>> thx. Heinz
>
> I had to do something similar with the Vietnamese Wikipedia's weekly
> featured article template
> <http://vi.wikipedia.org/wiki/Ti%C3%AAu_b%E1%BA%A3n:B%C3%A0i_vi%E1%BA%BFt_ch%E1%BB%8Dn_l%E1%BB%8Dc>.
> We used the {{CURRENTWEEK}} variable but I wanted an
> automatically-generated list of previous weeks' articles, so I used the
> switch template <http://en.wikipedia.org/wiki/Template:Switch> to map
> every week to a previous week, then every week to two weeks before, etc.
> It's verbose, but it works.
>
> With days, it's slightly more complicated, because each month has a
> different number of days, but if you're using that code to call a
> particular template or link to some page, then you can use a redirect
> from February 31 to March 2, for example, to call the correct template.
>
Your Idea was my first intention too. But you're rigtht it is quite
complicates, at least when you want to do it together with month and year.

Heinz

_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Computing with Variables

Jay Ashworth-2
In reply to this post by Heinz-Josef Lücking-2
On Tue, Feb 21, 2006 at 09:02:19AM +0100, Heinz wrote:
> How is it possible to do simple computing with Variables?
>
> I would like to to things like "{{currentday}}+1"

http://meta.wikimedia.org/wiki/Calc

Cheers,
-- jra
--
Jay R. Ashworth                                                [hidden email]
Designer                          Baylink                             RFC 2100
Ashworth & Associates        The Things I Think                        '87 e24
St Petersburg FL USA      http://baylink.pitas.com             +1 727 647 1274

        A: No.
        Q: Should I include quotations after my message body?
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l