<% @LANGUAGE = VBScript %> <% Option Explicit '============================================================================== 'schedule.asp ' 'Upcoming activities at Marpa Gompa '============================================================================== 'Modification History: ' 'Date Author Description of change '---------- -------------- -------------------------- '2004-04-03 Keith Walker original version '2004-04-16 Keith Walker calculates page date from file dates '2007-01-20 Keith Walker new DST algorithm '2007-01-31 Keith Walker include date of asp file in page date calculation ' '============================================================================== 'common code... %> <% '============================================================================================ 'page-specific code... gPageTitle = "Schedule" gPageDesc = "Upcoming activities at Marpa Gompa" gPageKeyWords = "" '============================================================================================ 'common code... %> <% '============================================================================================ %>

Here is our current schedule. All events are subject to change. We would recommend that you call if you have questions about our schedule.

Attendance is restricted for Pujas and special events. If you would like to know if it is possible for you to attend, please contact us. Shamatha Meditation and Dharma Study evenings are open to all those interested in attending. Again, please contact us prior to attending for the first time.



<% Dim LunarPhases(24, 2) Dim lPhaseCount Dim MostRecentFileDate Function GetMyDate() 'sets the date of this file Dim fso Dim TheFile Dim myFileSpec Dim MyFileDate Set fso = CreateObject("Scripting.FileSystemObject") myFileSpec = Server.MapPath("schedule.asp") If fso.FileExists(myFileSpec) Then set TheFile = fso.GetFile(myFilespec) MyFileDate = TheFile.DateLastModified Set TheFile = Nothing if MyFileDate > MostRecentFileDate then MostRecentFileDate = MyFileDate end if Else ShowFile = "" End If set fso = nothing End Function '---------- Function ShowFile(FileSpec) 'returns the contents of the text file Dim fso Dim TheFile Dim FileContents Dim myFileSpec Dim MyFileDate Set fso = CreateObject("Scripting.FileSystemObject") myFileSpec = Server.MapPath(FileSpec) If fso.FileExists(myFileSpec) Then Set TheFile = fso.OpenTextFile(myFileSpec, 1, False) FileContents= TheFile.readall ShowFile = FileContents TheFile.Close set TheFile = fso.GetFile(myFilespec) MyFileDate = TheFile.DateLastModified Set TheFile = Nothing if MyFileDate > MostRecentFileDate then MostRecentFileDate = MyFileDate end if Else ShowFile = "" End If set fso = nothing End Function '---------- Function makeDate(year, txtDate) 'converts text date to date type... makeDate = CDate(year & " " & txtDate) End Function '---------- Function GetTZDiff(whichDate, TimeZone) Dim whichMonth Dim WhichDay Dim TestDate whichMonth = month(whichdate) whichDay = day(whichdate) select case whichmonth case 1,2 GetTzDiff = CDbl(-7.0/24.0) TimeZone = "MST" case 3 TestDate = DateSerial(year(whichdate), 3, 1) 'march 1st while weekday(TestDate) <> 1 'first sunday TestDate = TestDate + 1 wend TestDate = TestDate + 7 'week later: second sunday if whichdate < TestDate then GetTZDiff = CDbl(-7.0/24.0) TimeZone = "MST" else GetTzDiff = CDbl(-6.0/24.0) TimeZone = "MDT" end if case 4,5,6,7,8,9,10 GetTzDiff = CDbl(-6.0/24.0) TimeZone = "MDT" case 11 TestDate = DateSerial(year(whichdate), 11, 1) 'nov 1st while weekday(TestDate) <> 1 '1st sunday TestDate = TestDate + 1 wend if whichdate < TestDate then GetTZDiff = CDbl(-6.0/24.0) TimeZone = "MDT" else GetTzDiff = CDbl(-7.0/24.0) TimeZone = "MST" end if case 12 GetTzDiff = CDbl(-7.0/24.0) TimeZone = "MST" end select End Function '---------- Sub ReadPhases() 'reads lunar phases from data file 'data obtained from: ' http://sunearth.gsfc.nasa.gov/eclipse/phase/phasecat.html Dim sFileLine Dim sPhYear Dim sPhNew Dim sPh1st Dim sPhFull Dim sPh3rd Dim sYear Dim dPhdate Dim bContinue Dim myFileSpec Dim fso Dim TextFile Dim sTimeZone Dim TheFile Dim MyFileDate Set fso = CreateObject("Scripting.FileSystemObject") myFileSpec = Server.MapPath("lunarphases.txt") set Textfile = fso.OpenTextFile(myFilespec, 1, false) set TheFile = fso.GetFile(myFilespec) MyFileDate = TheFile.DateLastModified Set TheFile = Nothing if MyFileDate > MostRecentFileDate then MostRecentFileDate = MyFileDate end if 'set timezone... 'Call getUTC lPhaseCount = 0 bContinue = True While bContinue And (Not Textfile.atendofstream) sFileLine = TextFile.ReadLine If Trim(sFileLine) <> "" Then 'non-blank line... sPhYear = Trim(Left(sFileLine, 8)) sPhNew = Trim(Mid(sFileLine, 9, 13)) sPh1st = Trim(Mid(sFileLine, 27, 13)) sPhFull = Trim(Mid(sFileLine, 45, 13)) sPh3rd = Trim(Mid(sFileLine, 63, 13)) If sPhYear <> "Year" Then 'not a header line... If sPhYear <> "" Then sYear = sPhYear End If If sPhNew <> "" Then dPhdate = makeDate(sYear, sPhNew) dPhdate = dPhdate + getTZdiff(dPhdate, sTimeZone) If dPhdate >= Date - 60 Then LunarPhases(lPhaseCount, 0) = dPhdate LunarPhases(lPhaseCount, 1) = 0 LunarPhases(lPhaseCount, 2) = sTimeZone lPhaseCount = lPhaseCount + 1 End If 'dPhDate End If 'sPhNew If sPhFull <> "" Then dPhdate = makeDate(sYear, sPhFull) dPhdate = dPhdate + getTZdiff(dPhdate, sTimeZone) If dPhdate >= Date - 60 Then LunarPhases(lPhaseCount, 0) = dPhdate LunarPhases(lPhaseCount, 1) = 2 LunarPhases(lPhaseCount, 2) = sTimeZone lPhaseCount = lPhaseCount + 1 End If 'dPhDate End If 'sPhFull If dPhdate > Date + 62 Then 'quit after reading two month's data... bContinue = False End If End If 'sPhYear End If 'trim(sFileLine) Wend 'not EOF TextFile.Close set fso = nothing set textfile = nothing End Sub '---------- Function FindPhase(whichDate) Dim Index For Index = 0 to lPhaseCount - 1 if int(LunarPhases(Index, 0)) = int(whichDate) then if LunarPhases(Index, 1) = 0 then FindPhase = "  New moon
" & FmtTime(LunarPhases(index, 0)) & " " & LunarPhases(index, 2) else FindPhase = "  Full moon
" & FmtTime(LunarPhases(index, 0)) & " " & LunarPhases(index, 2) end if Exit For else FindPhase = "" end if next End Function '======================================================= call ReadPhases FileContents = ShowFile("sched-dharmatopic.txt") if not isBlank(FileContents) then %>

Current Dharma Study Topic

<% =FileContents %>


<% End if %>
<% Dim CurDate Dim CurMonth Dim PrevMonth Dim MonthCount Dim FileContents Dim WeekdayInfo Dim CancelInfo Dim SpecialInfo Dim LunarInfo Dim LunarDate call GetMyDate() for curdate = date - 60 to date - 1 LunarInfo = FindPhase(CurDate) if InStr(LunarInfo, "New") > 0 then LunarDate = 0 else LunarDate = LunarDate + 1 Select Case LunarDate case 10 LunarInfo = "10th" case 25 LunarInfo = "25th" end select end if next CurDate = Date MonthCount = 0 PrevMonth = 0 While MonthCount <= 2 CurMonth = Month(CurDate) If CurMonth <> PrevMonth then PrevMonth = CurMonth MonthCount = MonthCount + 1 if MonthCount <= 2 then %> <% end if end if if MonthCount <= 2 then CancelInfo = showfile("sched-cx-" & FmtDateYmd(CurDate) & ".txt") if isBlank(CancelInfo) then WeekdayInfo = ShowFile("sched-" & FmtWeekday(CurDate) & ".txt") else WeekdayInfo = "" end if SpecialInfo = ShowFile("sched-" & FmtDateYmd(CurDate) & ".txt") LunarInfo = FindPhase(CurDate) if InStr(LunarInfo, "New") > 0 then LunarDate = 0 else LunarDate = LunarDate + 1 Select Case LunarDate case 10 LunarInfo = "10th" case 25 LunarInfo = "25th" end select end if If not isBlank(WeekdayInfo) or not isBlank(SpecialInfo) or not isBlank(LunarInfo) then %> <% End If End If CurDate = CurDate + 1 Wend gPageDate = MostRecentFileDate %>
<%=FmtDateMy(CurDate)%>
DayDateEventLunar
Calendar
<%=FmtWeekday(CurDate)%><%=FmtDateDm(CurDate)%> <%=WeekdayInfo%> <% if not isBlank(WeekdayInfo) and not isBlank(SpecialInfo) then %>
<% End If %> <%=SpecialInfo%>
<%=LunarInfo%>
<% '============================================================================================ 'common code... %> <% '============================================================================================ %>