[thelist] How to put a date-limit on SSIs?

Oliver Lineham oliver at lineham.co.nz
Wed Jan 31 21:20:48 CST 2001


At 23:48 31/01/2001 +0000, you wrote:

>Is there a way to use XSSI to include a file but only before a given date?

i was doing that for a while.

first by preparing the variables
<!--#config timefmt="%Y" --> <!--#set var="year" value="$DATE_LOCAL" -->
<!--#config timefmt="%m" --> <!--#set var="month" value="$DATE_LOCAL" -->
<!--#config timefmt="%d" --> <!--#set var="day" value="$DATE_LOCAL" -->

then:
<!--#if expr="($year<1999) || ($year=1999 && $month<02) || ($year=1999 && 
$month=02 && $day<18)"-->
  ... code (eg includes) here ...
<!--#endif -->

you can also put a <!--#else --> bit before the endif, if you want to 
include something different on and after the date

the #if expression is ugly, but basically says:
* if the current year is before 1999
or
* if the current year is 1999 but the month is before february
or
* if the current year is 1999 and current month is february but the day is 
before the 18th


server-side is definitely the way to go.

</ol>

____________________________________________________
  phone +64 21 210-7845       http://www.vibe.co.nz/
  po box 10-492              wellington, new zealand




More information about the thelist mailing list