<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [pmwiki-users] Conditional Directive based on time</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Patrick R. Michaud [<A HREF="mailto:pmichaud@pobox.com">mailto:pmichaud@pobox.com</A>] </FONT>
<BR><FONT SIZE=2>Sent: Tuesday, October 11, 2005 9:29 PM</FONT>
<BR><FONT SIZE=2>To: Miller, Joshua</FONT>
<BR><FONT SIZE=2>Cc: 'pmwiki-users@pmichaud.com'</FONT>
<BR><FONT SIZE=2>Subject: Re: [pmwiki-users] Conditional Directive based on time</FONT>
</P>
<P><FONT SIZE=2>On Tue, Oct 11, 2005 at 08:00:16PM -0400, Miller, Joshua wrote:</FONT>
<BR><FONT SIZE=2>> Hello all,</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I'm trying to set up a conditional directive for an event listing. The</FONT>
<BR><FONT SIZE=2>> general idea is that after an event takes place, it "disappears" from the</FONT>
<BR><FONT SIZE=2>> page...</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> The code would be something like this:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> (:if before12062005:)</FONT>
<BR><FONT SIZE=2>> Event that occurs on December 6, 2005</FONT>
<BR><FONT SIZE=2>> (:ifend:)</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> This way, the event would only display until December 6, 2005 and then</FONT>
<BR><FONT SIZE=2>> would "roll" off the webpage.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Can anyone help me out or get me started?</FONT>
</P>
<P><FONT SIZE=2>Actually, event listings based on dates were one of the reasons why I added conditional markup in the first place. :-)</FONT>
</P>
<P><FONT SIZE=2>How about conditionals like this instead ...?</FONT>
</P>
<P><FONT SIZE=2> (:if date 20051206-20051210 :) display during Dec 6-9, 2005</FONT>
<BR><FONT SIZE=2> (:if date -20051206 :) display before Dec 6, 2005</FONT>
<BR><FONT SIZE=2> (:if date 20051206- :) display on or after Dec 6, 2005</FONT>
<BR><FONT SIZE=2> (:if date 20051206 :) display only on Dec 6, 2005</FONT>
<BR><FONT SIZE=2> (:if ! date 20051206 :) display *except* on Dec 6, 2005 </FONT>
<BR><FONT SIZE=2> (:if date 200512 :) display during Dec 2005</FONT>
</P>
<P><FONT SIZE=2>-------------------------------</FONT>
</P>
<P><FONT SIZE=2>Ah- you caught me. I thought they already existed. My suggestion would be make the on or ...(before, after) more defined, like this:</FONT></P>
<P><FONT SIZE=2> (:if date 20051206-20051210 :) display during Dec 6-9, 2005</FONT>
<BR><FONT SIZE=2>> (:if date 20051206- :) display after Dec 6, 2005</FONT>
<BR><FONT SIZE=2> (:if date -20051206 :) display before Dec 6, 2005</FONT>
<BR><FONT SIZE=2>>> (:if date --20051206 :) display on or before Dec 6, 2005</FONT>
<BR><FONT SIZE=2>>> (:if date 20051206-- :) display on or after Dec 6, 2005</FONT>
<BR><FONT SIZE=2> (:if date 20051206 :) display only on Dec 6, 2005</FONT>
<BR><FONT SIZE=2> (:if ! date 20051206 :) display *except* on Dec 6, 2005 </FONT>
<BR><FONT SIZE=2> (:if date 200512 :) display during Dec 2005</FONT>
</P>
<P><FONT SIZE=2>>> new</FONT>
<BR><FONT SIZE=2>> change</FONT>
</P>
<P><FONT SIZE=2>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....</FONT></P>
<P><FONT SIZE=2>-Josh</FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</BODY>
</HTML>