[pmwiki-users] Conditional Directive based on time

Miller, Joshua web at cityofelmira.net
Wed Oct 12 07:32:05 CDT 2005


-----Original Message-----
From: Patrick R. Michaud [mailto:pmichaud at pobox.com] 
Sent: Tuesday, October 11, 2005 9:29 PM
To: Miller, Joshua
Cc: 'pmwiki-users at pmichaud.com'
Subject: Re: [pmwiki-users] Conditional Directive based on time

On Tue, Oct 11, 2005 at 08:00:16PM -0400, Miller, Joshua wrote:
>    Hello all,
> 
>    I'm trying to set up a conditional directive for an event listing.  The
>    general idea is that after an event takes place, it "disappears" from
the
>    page...
> 
>    The code would be something like this:
> 
>    (:if before12062005:)
>    Event that occurs on December 6, 2005
>    (:ifend:)
> 
>    This way, the event would only display until December 6, 2005 and then
>    would "roll" off the webpage.
> 
>    Can anyone help me out or get me started?

Actually, event listings based on dates were one of the reasons why I added
conditional markup in the first place.  :-)

How about conditionals like this instead ...?

    (:if date 20051206-20051210 :)   display during Dec 6-9, 2005
    (:if date -20051206 :)   display before Dec 6, 2005
    (:if date 20051206- :)   display on or after Dec 6, 2005
    (:if date 20051206 :)    display only on Dec 6, 2005
    (:if ! date 20051206 :)   display *except* on Dec 6, 2005 
    (:if date 200512 :)      display during Dec 2005

-------------------------------

Ah- you caught me.  I thought they already existed.  My suggestion would be
make the on or ...(before, after) more defined, like this:

    (:if date 20051206-20051210 :)   display during Dec 6-9, 2005
>   (:if date 20051206- :)   display after Dec 6, 2005
    (:if date -20051206 :)   display before Dec 6, 2005
>>  (:if date --20051206 :)  display on or before Dec 6, 2005
>>  (:if date 20051206-- :)  display on or after Dec 6, 2005
    (:if date 20051206 :)    display only on Dec 6, 2005
    (:if ! date 20051206 :)  display *except* on Dec 6, 2005 
    (:if date 200512 :)      display during Dec 2005

>> new
>  change

Anyone know enough about PHP's Date handling and PMWiki's Conditional
Directives to attempt this?  I'm still learning PHP and it's a bit out of my
range....

-Josh
















-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20051012/1ba01c55/attachment.html 


More information about the pmwiki-users mailing list