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

George Dillon george.dillon at ukonline.co.uk
Thu Feb 1 06:06:48 CST 2001


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

I have a page on my own site which lists forthcoming events, and I'd
like it to effectively update itself (by not including the info far dates in
the past dates).

I'm currently achieving what I want using client-side Javascript,
but I'd rather do it server-side if possible using XSSI.

Here's the URL: http://www.georgedillon.com/theatre/tour2001.shtml

I currently use SSI to set a JS variable (Var_date) for today's date.
The info about the dates on the tour looks a bit like this:

i=0;gigs=new Array();
i+=1;gigs[i]=new Array("010218","Tues - Sun","6th - 18th Feb","LONDON","The
King's Head","020 7226 1916")
i+=1;gigs[i]=new Array("010427","Wed - Fri","25 - 27 Apr","MANCHESTER","The
Green Room","0161 950 5900")

And the Javascript to determine whether or not to write each table row is:

gigstring=""
for (i=1;i<=gigs.length-1;i++)
{if(Var_date<=gigs[i][0])
 {gigstring+="<tr>"
  for (j=1;j<=5;j++)
   {gigstring+="<td>"+gigs[i][j]+"<\/td>"}
  gigstring+="<\/tr>"
 }
}
document.write(gigstring)

This works (in JS capable browsers), but how can I do this better?

TIA

George Dillon
PS Sorry if this is a repeat. I posted the same 11 hours ago and haven't
seen it yet :(







More information about the thelist mailing list