The code does work as a ssi.html when called in include file, like for a home page.
It is july now.. and It shows only events for aug, sept oct.
But the exact same code pulls in this month plus the next three months when i use it in Default.html in the templates.
Why does it work as a SSI and not as part of the default.
>>Well since $MONTH is a variable containing a reference to this month (the one being displayed), you could try $MONTH+1 in the following line of code:
I don't know why it works without the +1, but it does. when I add the +1 in the SSI file, it only pull from sept & oct, but not aug.
And in the default.html file, it still pulls all four months.
>>BTW. You may have problems with that code towards the end on the year as in December $MONTH will be 12 and adding 1 to it would ask the script for data starting month 13 which there is none.
I was hoping that this line would accomidate that ...
if ($MONTH+3 > 11) { $endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-8, $YEAR-1899) - 1; }
since the months are 0 thru 11, correct??
I was trying to modify the code I found here designed to show this month and next months events. http://www.calendarscript.com/support/forum/Forum4/HTML/000217.html
code:
<%
$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-1, $YEAR-1900);
$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH+1, $YEAR-1900) - 1;
if ($MONTH+1 > 11) { $endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-11, $YEAR-1899) - 1; }
&getEvents( {'start'=>$startTime, 'end'=>$endTime});
%>
------------------
[This message has been edited by Alvy (edited July 22, 2003).]