<!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>&gt;&nbsp;&nbsp;&nbsp; Hello all,</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; I'm trying to set up a conditional directive for an event listing.&nbsp; The</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; general idea is that after an event takes place, it &quot;disappears&quot; from the</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; page...</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; The code would be something like this:</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; (:if before12062005:)</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; Event that occurs on December 6, 2005</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; (:ifend:)</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; This way, the event would only display until December 6, 2005 and then</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; would &quot;roll&quot; off the webpage.</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; 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.&nbsp; :-)</FONT>
</P>

<P><FONT SIZE=2>How about conditionals like this instead ...?</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if date 20051206-20051210 :)&nbsp;&nbsp; display during Dec 6-9, 2005</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if date -20051206 :)&nbsp;&nbsp; display before Dec 6, 2005</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if date 20051206- :)&nbsp;&nbsp; display on or after Dec 6, 2005</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if date 20051206 :)&nbsp;&nbsp;&nbsp; display only on Dec 6, 2005</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if ! date 20051206 :)&nbsp;&nbsp; display *except* on Dec 6, 2005 </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if date 200512 :)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; display during Dec 2005</FONT>
</P>

<P><FONT SIZE=2>-------------------------------</FONT>
</P>

<P><FONT SIZE=2>Ah- you caught me.&nbsp; I thought they already existed.&nbsp; My suggestion would be make the on or ...(before, after) more defined, like this:</FONT></P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if date 20051206-20051210 :)&nbsp;&nbsp; display during Dec 6-9, 2005</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp; (:if date 20051206- :)&nbsp;&nbsp; display after Dec 6, 2005</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if date -20051206 :)&nbsp;&nbsp; display before Dec 6, 2005</FONT>
<BR><FONT SIZE=2>&gt;&gt;&nbsp; (:if date --20051206 :)&nbsp; display on or before Dec 6, 2005</FONT>
<BR><FONT SIZE=2>&gt;&gt;&nbsp; (:if date 20051206-- :)&nbsp; display on or after Dec 6, 2005</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if date 20051206 :)&nbsp;&nbsp;&nbsp; display only on Dec 6, 2005</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if ! date 20051206 :)&nbsp; display *except* on Dec 6, 2005 </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; (:if date 200512 :)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; display during Dec 2005</FONT>
</P>

<P><FONT SIZE=2>&gt;&gt; new</FONT>
<BR><FONT SIZE=2>&gt;&nbsp; change</FONT>
</P>

<P><FONT SIZE=2>Anyone know enough about PHP's Date handling and PMWiki's Conditional Directives to attempt this?&nbsp; 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>