<% 'Sets the Locale ID session property - www.ultra-dumb.co.uk Session.LCID = 1033 %><% Function FormatStr(String) ' Replaces a double carrige return with a paragraph break ' a single carrige return with a break rule and CHR(13) with nothing String = Replace(String, CHR(13), "") String = Replace(String, CHR(10) & CHR(10), "

") String = Replace(String, CHR(10), "
") FormatStr = String End Function ' ---------- Page Variables ---------- Const intCharToShow = 40 ' The number of characters shown in each day Const bolEditable = True ' If the calendar is editable or not (Can be tied into password verification) Dim dtToday ' Today's Date Dim dtCurrentDate ' The current date Dim aCalendarDays(42) ' Array of possible calendar dates Dim iFirstDayOfMonth ' The first day of the month Dim iDaysInMonth ' The number of days in the month Dim iColumns, iRows , iDay, iWeek ' The numer of columns and rows in the table, and counters to print them Dim objConn, strConn, strSQL, objRS ' Database Variables Dim counter ' Loop counter Dim strNextMonth, strPrevMonth ' The next and previous month dates Dim dailyMsg ' The message for the day Dim dtOnDay ' The current day being displayed by the loops Dim strPage ' The link that each day takes you too ' ---------- Variable Definitions ---------- dtToday = Date() If Request("currentDate") <> "" Then dtCurrentDate = Request("currentDate") Else dtCurrentDate = dtToday End If iFirstDayOfMonth = DatePart("w", DateSerial(Year(dtCurrentDate), Month(dtCurrentDate), 1)) iDaysInMonth = DatePart("d", DateSerial(Year(dtCurrentDate), Month(dtCurrentDate)+1, 1-1)) For counter = 1 to iDaysInMonth aCalendarDays(counter + iFirstDayOfMonth - 1) = counter Next iColumns = 7 iRows = 6 - Int((42 - (iFirstDayOfMonth + iDaysInMonth)) / 7) strPrevMonth = Server.URLEncode(DateAdd("m", -1, dtCurrentDate)) strNextMonth = Server.URLEncode(DateAdd("m", 1, dtCurrentDate)) ' ---------- Drawing the Calendar ---------- %>