<%@ LANGUAGE = VBScript %> <% Server.ScriptTimeout = 3600 %> <% ' HEADER ********************************************************************** %> <% ' END HEADER ****************************************************************** ' DESCRIPTION ***************************************************************** ' Name: CEventsListing.asp ' Author: Bob Doyle and Derek Doyle ' Copyright 2001-2003 skyBuilders.com. All rights reserved. GPL ' ' 2003/01/31 bob ' updated to 2003, new dates, new frames arrangement ' 2001/03/23 dtd ' two new functions for this page to perform: ' cacheListing - this writes the largest web listing out to a file "CEventsListing.html" - when the state requested is show dates and all dates simultaneously, that .html cached version should be called instead of this .asp page, for a faster load (theoretically, though bits take time one way or another - test speed) ' phoenixListing - this writes the full listing (including descriptions, but hiding dates) to phoenixListing.html, which should be print- and word-friendly. ' ' can the contents of the response object be written to a server-side file? ' No. ' this means a rewrite of all the responses to a variable 'listingSource' instead, which can then be written to a file or out to the page depending on the case of doWhat ' ' curently tests at 20 min + for cache listing - try splitting up the vars ' END DESCRIPTION ************************************************************* ' SERVER DECLARATIONS ********************************************************* Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 Const TriStateASCII = 0 Const TriStateUnicode = -1 Const TriStateDefault = -2 Const WindowsFolder = 0 Const SystemFolder = 1 Const TempFolder = 2 Dim objFSO, objFile, objPage, objTxt Dim TargetDate, FilterType, FilterValue, SearchTarget, Handicap, hideDatesFlag, whichEventID Dim dateString Dim EventID, EventName, EventStart, EventEnd, EventDescription, EventPlaceGroupID, EventPlaceGroupName, EventPlaceName, EventPlaceURL, EventFree, EventHandicapAccess, EventMap, EventNew, EventFilter, EventSeriesID, EventSeriesURL, numEvent, numEvents Dim oSeries, numSeries, numSerieses ' oSeriesID, oSeriesFree, oSeriesHandicapAccess, oSeriesMap, oSeriesNew, Dim showListingEntry, EventSeriesListed Dim rangeClause, rangeStart, rangeEnd Dim TargetStart, TargetEnd Dim FilterClause Dim FilterHeading, DateHeading Dim ListingHeadSize, ListingBodySize Dim timeWhere Dim sListingSource, sLoopSource, sFileGeneration Dim sCatOrderClause ' END SERVER DECLARATIONS ***************************************************** ' SERVER SUBROUTINES ********************************************************** ' END SERVER SUBROUTINES ****************************************************** ' REQUEST ********************************************************************* doWhat = Request.QueryString("doWhat") TargetDate = Request.QueryString("TargetDate") FilterType = Request.QueryString("FilterType") FilterValue = Request.QueryString("FilterValue") SearchTarget = Request.QueryString("SearchTarget") Handicap = Request.QueryString("Handicap") hideDatesFlag = Request.QueryString("hideDatesFlag") whichEventID = Request.QueryString("whichEventID") If (0 = 1) Then Response.Write("
hideDatesFlag = " & hideDatesFlag) Response.Write("
FilterType = " & FilterType) Response.Write("
FilterValue = " & FilterValue) Response.Write("
SearchTarget = " & SearchTarget) Response.Write("
TargetDate = " & TargetDate) Response.Write("
whichEventID = " & whichEventID) Response.Write("
") ' Response.Flush End If ' END REQUEST ***************************************************************** ' SQL QUERIES ***************************************************************** EventsColor = mGetColor("EventsColor") EventsDarkColor = mGetColor("EventsDarkColor") ScheduleColor = mGetColor("ScheduleColor") ' END SQL QUERIES *********************************************************** ' SERVER LOGIC ************************************************************** If ((doWhat = "") AND (whichEventID = "") AND (TargetDate = "") AND (FilterType = "") AND (hideDatesFlag = "False")) Then ' this is the cache case - the listing of everything for all dates with dates showing Response.Redirect("CEventsListing.html") End If ' both cacheListing and phoenixListing need checking for here ' if either one is the case, then the response has to be written to a file instead of flushed, and the appropriate switches thrown to format the listing Set objFSO = CreateObject("Scripting.FileSystemObject") sFileGeneration = "False" If (doWhat = "cacheListing") OR (doWhat = "phoenixListing") Then sFileGeneration = "True" ' now set state to All Dates (is default) and Show Dates hideDatesFlag = "False" Response.Write("All dates/Show dates cache listing generation begins:") Response.Flush End If If (doWhat = "phoenixListing") Then sFileGeneration = "True" ' now set state to All Dates (is default) and Show Dates hideDatesFlag = "True" # CAREFUL WITH THIS LINE, IT DEFINES THE RELEVANT CALENDAR RANGE! TargetDate = "4/23/2003,5/11/2003" FilterType = "Categories" Response.Write("Phoenix listing generation begins:") Response.Flush End If Set oSeries = Server.CreateObject("Scripting.Dictionary") If (Handicap = "True") Then ListingHeadSize = "+2" ListingBodySize = "+1" Else If (whichEventID = "") Then ListingHeadSize = "-1" ListingBodySize = "-1" Else ListingBodySize = "3" End If End If If (whichEventID = "") Then ListingBodyTextColor = "#888888" Else ListingBodyTextColor = "#000000" End If If (hideDatesFlag = "") Then hideDatesFlag = "True" End If If (hideDatesFlag = "True") Then TimeClause = "" Else TimeClause = "ODBM_Reservations.MSStart, " End If timeWhere = timeWhere & FormatDateTime(Now(), 3) & " Response

" ' RESPONSE ******************************************************************** sListingSource = "" ' open the page sListingSource = sListingSource & "" & Chr(13) & "" & Chr(13) & "Cyberarts Events Listing" & Chr(13) & "" & Chr(13) & "" & Chr(13) & "" & Chr(13) & "" & Chr(13) If ((doWhat = "cacheListing") OR ((TargetDate = "") AND (FilterType = "") AND (hideDatesFlag = "False"))) Then ' give a warning about the file size and time to download sListingSource = sListingSource & "Warning: This page is about 1.25 megabytes in size. On slower connections, it could take a few minutes to download.

" End If ' replace all flushes with this struct If (sFileGeneration = "False") Then Response.Write(sListingSource) sListingSource = "" Response.flush Else ' Response.Write("
table start") ' Response.flush End If ' check filter type and get events appropriate to the filter value DaylightSeconds = DateDiff("S", sServerUEStart, "4/1/2001 2:00 AM") If (TargetDate = "") Then rangeClause = "" Else ' transform TargetDate into rangeStart and rangeEnd If (InStr(TargetDate, ",")) Then ' split input into start and end dates TargetStart = Left(TargetDate, InStr(TargetDate, ",") - 1) TargetEnd = Right(TargetDate, Len(TargetDate) - InStr(TargetDate, ",")) If (0 = 1) Then Response.Write("
TargetStart = " & TargetStart) Response.Write("
TargetEnd = " & TargetEnd) End If ' assign dates to range MSs (add one day to the end date to put it at midnight of the next day, that is, the end of the input day) rangeStart = DateDiff("S", sServerUEStart, TargetStart) rangeEnd = DateDiff("S", sServerUEStart, DateAdd("d", 1, TargetEnd)) ' If either Start or End is at or after DaylightSeconds, subtract (or add?) an hour from it to correct for DST If (rangeStart >= DaylightSeconds) Then rangeStart = rangeStart - 3600 End If If (rangeEnd >= DaylightSeconds) Then rangeEnd = rangeEnd - 3600 End If rangeStart = rangeStart & "000" rangeEnd = rangeEnd & "000" If (0 = 1) Then Response.Write("
sServerUEStart = " & sServerUEStart) Response.Write("
rangeStart = " & rangeStart) Response.Write("
rangeEnd = " & rangeEnd) End If Else ' rangeStart = MS of TargetDate ' rangeEnd = MS of TargetDate + 1 day rangeStart = DateDiff("S", sServerUEStart, TargetDate) rangeEnd = DateDiff("S", sServerUEStart, DateAdd("d", 1, TargetDate)) ' If either Start or End is at or after DaylightSeconds, subtract (or add?) an hour from it to correct for DST If (rangeStart >= DaylightSeconds) Then rangeStart = rangeStart - 3600 End If If (rangeEnd >= DaylightSeconds) Then rangeEnd = rangeEnd - 3600 End If rangeStart = rangeStart & "000" rangeEnd = rangeEnd & "000" If (0 = 1) Then Response.Write("
sServerUEStart = " & sServerUEStart) Response.Write("
rangeStart = " & rangeStart) Response.Write("
rangeEnd = " & rangeEnd) End If End If rangeClause = " AND NOT ((ODBM_Reservations.MSStart - " & rangeEnd & " > 0) OR (ODBM_Reservations.MSStart - " & rangeStart & " < 0))" End If If (whichEventID = "") Then Select Case FilterType Case "Organizations" If (0 = 1) Then Response.Write("
rangeStart = " & rangeStart) Response.Write("
rangeEnd = " & rangeEnd) End If If (FilterValue = "") Then FilterClause = " AND (CStr(ODBM_VirtualColumnText.VColText) = CStr(ODBM_Options.ID))" Else FilterClause = " AND (CStr(ODBM_VirtualColumnText.VColText) = CStr(ODBM_Options.ID)) AND (ODBM_Options.Option1 = '" & mUnQuote(FilterValue) & "')" End If ' All events that start during the day selected, with their organizations attribute matching FilterValue SQLQuery = "SELECT DISTINCTROW ODBM_Reservations.ID AS EventID, ODBM_Reservations.EventSeriesID, ODBM_Reservations.Name, ODBM_Reservations.MSStart, ODBM_Reservations.MSEnd, ODBM_Reservations.ItemID, ODBM_Reservations.Comment AS EventDescription, ODBM_EventSeries.Comment AS EventSeriesDescription, ODBM_EventSeries.SeriesURL, ODBM_Items.ID AS PlaceID, ODBM_Items.ItemName, ODBM_Items.ItemURL, ODBM_ItemGroups.GroupName, ODBM_ItemGroups.ID AS PlaceGroupID, ODBM_VirtualColumnText.VColText, ODBM_Options.Option1 FROM (((((((((ODBM_Reservations INNER JOIN ODBM_EventSeries ON (ODBM_Reservations.EventSeriesID = ODBM_EventSeries.ID)) INNER JOIN ODBM_Items ON (ODBM_Reservations.ItemID = ODBM_Items.ID)) INNER JOIN ODBM_Item_Group ON (ODBM_Items.ID = ODBM_Item_Group.ItemID)) INNER JOIN ODBM_ItemGroups ON (ODBM_Item_Group.GroupID = ODBM_ItemGroups.ID)) INNER JOIN ODBM_VirtualColumnText ON (ODBM_EventSeries.ID = ODBM_VirtualColumnText.ForeignKey)) INNER JOIN ODBM_VirtualColumns ON (ODBM_VirtualColumnText.VColID = ODBM_VirtualColumns.ID)) INNER JOIN ODBM_Selects ON (ODBM_VirtualColumns.VColName = ODBM_Selects.Select1)) INNER JOIN ODBM_Select_Option ON (ODBM_Selects.ID = ODBM_Select_Option.SelectID)) INNER JOIN ODBM_Options ON (ODBM_Select_Option.OptionID = ODBM_Options.ID)) WHERE (((ODBM_VirtualColumns.whichTable = 'ODBM_EventSeries') AND (ODBM_VirtualColumns.VColName = 'Organizations')" & FilterClause & ") AND (ItemType = 'Place')" & rangeClause & ") ORDER BY " & TimeClause & "ODBM_Options.Option1, ODBM_Items.ItemName, ODBM_Item_Group.SortNum;" ' Response.Write("
SQLQuery = " & SQLQuery) Case "Categories" If (0 = 1) Then Response.Write("
rangeStart = " & rangeStart) Response.Write("
rangeEnd = " & rangeEnd) End If If (FilterValue = "") Then FilterClause = " AND (CStr(ODBM_VirtualColumnText.VColText) = CStr(ODBM_Options.ID))" Else FilterClause = " AND (CStr(ODBM_VirtualColumnText.VColText) = CStr(ODBM_Options.ID)) AND (ODBM_Options.Option1 = '" & mUnQuote(FilterValue) & "')" End If If ((FilterValue = "Performances") OR (FilterValue = "Screenings")) Then sCatOrderClause = TimeClause & "ODBM_Reservations.Name, ODBM_Items.ItemName, ODBM_Options.Option1, ODBM_Item_Group.SortNum;" Else sCatOrderClause = TimeClause & "ODBM_Options.Option1, ODBM_Items.ItemName, ODBM_Item_Group.SortNum;" End If ' All events that start during the day selected, with their organizations attribute matching FilterValue SQLQuery = "SELECT DISTINCTROW ODBM_Reservations.ID AS EventID, ODBM_Reservations.EventSeriesID, ODBM_Reservations.Name, ODBM_Reservations.MSStart, ODBM_Reservations.MSEnd, ODBM_Reservations.ItemID, ODBM_Reservations.Comment AS EventDescription, ODBM_EventSeries.Comment AS EventSeriesDescription, ODBM_EventSeries.SeriesURL, ODBM_Items.ID AS PlaceID, ODBM_Items.ItemName, ODBM_Items.ItemURL, ODBM_ItemGroups.GroupName, ODBM_ItemGroups.ID AS PlaceGroupID, ODBM_VirtualColumnText.VColText, ODBM_Options.Option1 FROM (((((((((ODBM_Reservations INNER JOIN ODBM_EventSeries ON (ODBM_Reservations.EventSeriesID = ODBM_EventSeries.ID)) INNER JOIN ODBM_Items ON (ODBM_Reservations.ItemID = ODBM_Items.ID)) INNER JOIN ODBM_Item_Group ON (ODBM_Items.ID = ODBM_Item_Group.ItemID)) INNER JOIN ODBM_ItemGroups ON (ODBM_Item_Group.GroupID = ODBM_ItemGroups.ID)) INNER JOIN ODBM_VirtualColumnText ON (ODBM_EventSeries.ID = ODBM_VirtualColumnText.ForeignKey)) INNER JOIN ODBM_VirtualColumns ON (ODBM_VirtualColumnText.VColID = ODBM_VirtualColumns.ID)) INNER JOIN ODBM_Selects ON (ODBM_VirtualColumns.VColName = ODBM_Selects.Select1)) INNER JOIN ODBM_Select_Option ON (ODBM_Selects.ID = ODBM_Select_Option.SelectID)) INNER JOIN ODBM_Options ON (ODBM_Select_Option.OptionID = ODBM_Options.ID)) WHERE (((ODBM_VirtualColumns.whichTable = 'ODBM_EventSeries') AND (ODBM_VirtualColumns.VColName = 'Categories')" & FilterClause & ") AND (ItemType = 'Place')" & rangeClause & ") ORDER BY " & sCatOrderClause Case "Locations" If (0 = 1) Then Response.Write("
rangeStart = " & rangeStart) Response.Write("
rangeEnd = " & rangeEnd) End If If (FilterValue = "") Then FilterClause = "" Else FilterClause = "(ODBM_ItemGroups.GroupName = '" & mUnQuote(FilterValue) & "') AND " End If ' All events that start during the day selected, with their place group name matching FilterValue SQLQuery = "SELECT DISTINCTROW ODBM_Reservations.ID AS EventID, ODBM_Reservations.EventSeriesID, ODBM_Reservations.Name, ODBM_Reservations.MSStart, ODBM_Reservations.MSEnd, ODBM_Reservations.ItemID, ODBM_Reservations.Comment AS EventDescription, ODBM_EventSeries.Comment AS EventSeriesDescription, ODBM_EventSeries.SeriesURL, ODBM_Items.ID AS PlaceID, ODBM_Items.ItemName, ODBM_Items.ItemURL, ODBM_ItemGroups.GroupName, ODBM_ItemGroups.ID AS PlaceGroupID FROM ((((ODBM_Reservations INNER JOIN ODBM_EventSeries ON (ODBM_Reservations.EventSeriesID = ODBM_EventSeries.ID)) INNER JOIN ODBM_Items ON (ODBM_Reservations.ItemID = ODBM_Items.ID)) INNER JOIN ODBM_Item_Group ON (ODBM_Items.ID = ODBM_Item_Group.ItemID)) INNER JOIN ODBM_ItemGroups ON (ODBM_Item_Group.GroupID = ODBM_ItemGroups.ID)) WHERE (" & FilterClause & "(ItemType = 'Place')" & rangeClause & ") ORDER BY " & TimeClause & "ODBM_ItemGroups.GroupName, ODBM_Items.ItemName, ODBM_Item_Group.SortNum;" Case "" If (0 = 1) Then Response.Write("
rangeStart = " & rangeStart) Response.Write("
rangeEnd = " & rangeEnd) End If ' All events that start during the day selected SQLQuery = "SELECT DISTINCTROW ODBM_Reservations.ID AS EventID, ODBM_Reservations.EventSeriesID, ODBM_Reservations.Name, ODBM_Reservations.MSStart, ODBM_Reservations.MSEnd, ODBM_Reservations.ItemID, ODBM_Reservations.Comment AS EventDescription, ODBM_EventSeries.Comment AS EventSeriesDescription, ODBM_EventSeries.SeriesURL, ODBM_Items.ID AS PlaceID, ODBM_Items.ItemName, ODBM_Items.ItemURL, ODBM_ItemGroups.GroupName, ODBM_ItemGroups.ID AS PlaceGroupID FROM ((((ODBM_Reservations INNER JOIN ODBM_EventSeries ON (ODBM_Reservations.EventSeriesID = ODBM_EventSeries.ID)) INNER JOIN ODBM_Items ON (ODBM_Reservations.ItemID = ODBM_Items.ID)) INNER JOIN ODBM_Item_Group ON (ODBM_Items.ID = ODBM_Item_Group.ItemID)) INNER JOIN ODBM_ItemGroups ON (ODBM_Item_Group.GroupID = ODBM_ItemGroups.ID)) WHERE ((ItemType = 'Place')" & rangeClause & ") ORDER BY " & TimeClause & "ODBM_Items.ItemName, ODBM_Item_Group.SortNum;" End Select Else ' whichEventID has a value SQLQuery = "SELECT DISTINCTROW ODBM_Reservations.ID AS EventID, ODBM_Reservations.EventSeriesID, ODBM_Reservations.Name, ODBM_Reservations.MSStart, ODBM_Reservations.MSEnd, ODBM_Reservations.ItemID, ODBM_Reservations.Comment AS EventDescription, ODBM_EventSeries.Comment AS EventSeriesDescription, ODBM_EventSeries.SeriesURL, ODBM_Items.ID AS PlaceID, ODBM_Items.ItemName, ODBM_Items.ItemURL, ODBM_ItemGroups.GroupName, ODBM_ItemGroups.ID AS PlaceGroupID FROM ((((ODBM_Reservations INNER JOIN ODBM_EventSeries ON (ODBM_Reservations.EventSeriesID = ODBM_EventSeries.ID)) INNER JOIN ODBM_Items ON (ODBM_Reservations.ItemID = ODBM_Items.ID)) INNER JOIN ODBM_Item_Group ON (ODBM_Items.ID = ODBM_Item_Group.ItemID)) INNER JOIN ODBM_ItemGroups ON (ODBM_Item_Group.GroupID = ODBM_ItemGroups.ID)) WHERE ODBM_Reservations.ID = " & whichEventID & ";" End If ' Response.Write("
SQLQuery = " & SQLQuery) Set SELECTEvents = oDBConnection.Execute(SQLQuery) timeWhere = timeWhere & FormatDateTime(Now(), 3) & " SELECTEvents

" ' Dim Cmd As New ADODB.Command ' Dim prm1 As New ADODB.Parameter ' Dim prm2 As New ADODB.Parameter Set Cmd = Server.CreateObject("ADODB.Command") Cmd.ActiveConnection = oDBConnection ' template: Cmd.CommandText = "update titles set type=? where title_id=?" Cmd.CommandText = "SELECT * FROM (ODBM_VirtualColumnText INNER JOIN ODBM_VirtualColumns ON (ODBM_VirtualColumnText.VColID = ODBM_VirtualColumns.ID)) WHERE ((ODBM_VirtualColumnText.ForeignKey = ?) AND (ODBM_VirtualColumns.whichTable = 'ODBM_EventSeries') AND ((ODBM_VirtualColumns.VColName = 'Free') OR (ODBM_VirtualColumns.VColName = 'Handicap Access') OR (ODBM_VirtualColumns.VColName = 'New')));" Cmd.CommandType = adCmdText Cmd.Prepared = True Set prm1 = Cmd.CreateParameter("EventSeriesID") prm1.Type = adInteger prm1.Direction = adParamInput prm1.Size = 12 prm1.Value = 1 Cmd.Parameters.Append prm1 ' prepare for response loop If (1 = 1) Then dateString = " TargetDate = " & TargetDate & "
FilterType = " & FilterType & "; FilterValue = " & FilterValue End If If (hideDatesFlag = "True") Then DateandTimeClause = "" Else DateandTimeClause = " and Date and Time" End If ' if there has been no selection on the calendar, default to today if today is one of the days of the festival. otherwise, default to: Select Case FilterType Case "Categories" FilterTypeSingular = "Category" Case "Locations" FilterTypeSingular = "Location" Case "Organizations" FilterTypeSingular = "Organization" End Select If (TargetDate = "") Then If NOT (FilterType = "") Then If (FilterValue = "") Then dateString = "All Cyberarts Events sorted by " & FilterTypeSingular ' & DateandTimeClause Else dateString = "Cyberarts " & FilterValue & " Events" ' sorted by " & FilterTypeSingular ' & DateandTimeClause End If Else dateString = "All Cyberarts Events" ' sorted by Date and Time" End If Else If (FilterValue = "") Then dateString = "All Cyberarts Events for " Else dateString = "Cyberarts " & FilterValue & " Events for " End If If (InStr(TargetDate, ",")) Then ' input has above been split into start and end dates dateString = dateString & FormatDateTime(TargetStart, 1) & " - " & FormatDateTime(TargetEnd, 1) Else ' Response.Write("
TargetDate = " & TargetDate) dateString = dateString & FormatDateTime(TargetDate, 1) End If If (FilterValue = "") AND NOT (FilterType = "") Then dateString = dateString & " sorted by " & FilterTypeSingular End If ' DayName(TargetDate) & ", " & MonthName(TargetDate) & " " & Date(TargetDate) & ", " & Year(TargetDate) End If If NOT (whichEventID = "") Then sListingSource = sListingSource & Chr(13) & " & Chr(34) & " End If If (whichEventID = "") Then sListingSource = sListingSource & Chr(13) & "" & dateString & "" If (0 = 1) Then ' was: If NOT (FilterValue = "") Then sListingSource = sListingSource & "" & Chr(13) & "" & Chr(13) & "

" & FilterValue & "

" & Chr(13) & "" & Chr(13) & "" End If End If ' the included functions are required for timezone corrections to take place %> <% If (sFileGeneration = "False") Then Response.Write(sListingSource) sListingSource = "" Response.flush Else ' Response.Write("
after query") ' Response.flush End If timeWhere = timeWhere & FormatDateTime(Now(), 3) & " start spill

" EventSeriesListed = "," numEvent = 0 numSeries = 0 Do While Not (SELECTEvents.EOF) numEvent = numEvent + 1 If (numEvent = 1) Then timeWhere = timeWhere & FormatDateTime(Now(), 3) & " loop begins

" End If sLoopSource = "" MSStart = SELECTEvents("MSStart") MSEnd = SELECTEvents("MSEnd") EventSeriesID = SELECTEvents("EventSeriesID") EventSeriesURL = SELECTEvents("SeriesURL") If (EventSeriesURL = "http://") Then EventSeriesURL = "" End If ' get attributes - only for print-friendly/details display, or phoenixListing If (NOT (whichEventID = "")) OR (doWhat = "phoenixListing") Then ' proposal code for transferring from checking series attribiutes for each event to keeping attributes in series-based arrays ' loop through aSeriesID and check whether EventSeriesID is in it yet ' if it is, then write values across from series to event arrays AttributesIndexed = "False" If (oSeries(EventSeriesID) = EventSeriesID) Then ' if it is, then write values across from series to event arrays AttributesIndexed = "True" EventFree = oSeries("Free" & EventSeriesID) EventHandicapAccess = oSeries.Item("HandicapAccess" & EventSeriesID) EventMap = oSeries("Map" & EventSeriesID) EventNew = oSeries("New" & EventSeriesID) End If If (AttributesIndexed = "False") Then numSeries = numSeries + 1 ' add a key named for this SeriesID with the value of SeriesID ' oSeriesID.Add EventSeriesID, oSeries If NOT (oSeries(EventSeriesID) = EventSeriesID) Then oSeries(EventSeriesID) = EventSeriesID End If ' the following line adds a new key name "Free" to our second-dimension dicitionary ' oSeriesID.Item(EventSeriesID).Add "Free", "False" ' make text and memo attribute queries ' write values to both series and event arrays timeWhere = timeWhere & FormatDateTime(Now(), 3) & " new series = " & EventSeriesID & "

" ' was: "SELECT * FROM (ODBM_VirtualColumnText INNER JOIN ODBM_VirtualColumns ON (ODBM_VirtualColumnText.VColID = ODBM_VirtualColumns.ID)) WHERE ((ODBM_VirtualColumnText.ForeignKey = ?) AND (ODBM_VirtualColumns.whichTable = 'ODBM_EventSeries') AND ((ODBM_VirtualColumns.VColName = 'Free') OR (ODBM_VirtualColumns.VColName = 'Handicap Access') OR (ODBM_VirtualColumns.VColName = 'New')));" SQLQuery = "SELECT * FROM (ODBM_VirtualColumnText INNER JOIN ODBM_VirtualColumns ON (ODBM_VirtualColumnText.VColID = ODBM_VirtualColumns.ID)) WHERE ((ODBM_VirtualColumnText.ForeignKey = " & EventSeriesID & ") AND (ODBM_VirtualColumns.whichTable = 'ODBM_EventSeries') AND ((ODBM_VirtualColumns.VColName = 'Free') OR (ODBM_VirtualColumns.VColName = 'Handicap Access') OR (ODBM_VirtualColumns.VColName = 'New')));" ' Response.Write("
SQLQuery = " & SQLQuery) Set SELECTEventSeries = oDBConnection.Execute(SQLQuery) ' Insert command execution here: ' Cmd.Parameters("EventSeriesID") = EventSeriesID ' Response.Write("
SQLQuery = " & Cmd.CommandText) ' Set SELECTEventSeries = Cmd.Execute(numRecords, EventSeriesID, adCmdText) If (numEvent = 1) Then timeWhere = timeWhere & FormatDateTime(Now(), 3) & " EventFree

" End If EventFree = "False" EventHandicapAccess = "False" EventNew = "False" oSeries.Add "Free" & EventSeriesID, "False" oSeries.Add "HandicapAccess" & EventSeriesID, "False" oSeries.Add "New" & EventSeriesID, "False" numAttribute = 0 Do While NOT (SELECTEventSeries.EOF) numAttribute = numAttribute + 1 ' Response.Write("
VColName = " & SELECTEventSeries("VColName")) ' Response.Write("
VColText = " & SELECTEventSeries("VColText")) If (SELECTEventSeries("VColText") = "True") Then Select Case SELECTEventSeries("VColName") Case "Free" EventFree = "True" oSeries("Free" & EventSeriesID) = "True" Case "Handicap Access" EventHandicapAccess = "True" oSeries("HandicapAccess" & EventSeriesID) = "True" Case "New" EventNew = "True" oSeries("New" & EventSeriesID) = "True" End Select End If SELECTEventSeries.MoveNext Loop numAttributes = numAttribute ' timeWhere = timeWhere & FormatDateTime(Now(), 3) & " numAttributes = " & numAttributes & "

" SQLQuery = "SELECT * FROM (ODBM_VirtualColumnMemo INNER JOIN ODBM_VirtualColumns ON (ODBM_VirtualColumnMemo.VColID = ODBM_VirtualColumns.ID)) WHERE ((ODBM_VirtualColumnMemo.ForeignKey = " & EventSeriesID & ") AND (ODBM_VirtualColumns.whichTable = 'ODBM_EventSeries') AND (ODBM_VirtualColumns.VColName = 'Map'));" ' Response.Write("
SQLQuery = " & SQLQuery) Set SELECTEventSeries = oDBConnection.Execute(SQLQuery) If (numEvent = 1) Then timeWhere = timeWhere & FormatDateTime(Now(), 3) & " EventMap

" End If EventMap = "False" oSeries.Add "Map" & EventSeriesID, "False" If NOT (SELECTEventSeries.EOF) Then EventMap = SELECTEventSeries("VColMemo") oSeries("Map" & EventSeriesID) = EventMap End If End If End If numSerieses = numSeries EventID = SELECTEvents("EventID") EventStart = MSStart EventEnd = MSEnd EventName = mUnNull(SELECTEvents("Name")) If (0 = 1) Then Response.Write("
Name = " & EventName) Response.Write("
MSStart = " & MSStart) Response.Write("
MSEnd = " & MSEnd) End If thisEventSeriesDescription = mUnNull(SELECTEvents("EventSeriesDescription")) thisEventDescription = mUnNull(SELECTEvents("EventDescription")) ' do not mReQuote these, as they may contain HTML tags If NOT (thisEventSeriesDescription = "") Then EventDescription = thisEventSeriesDescription End If If (NOT (thisEventDescription = "") AND NOT (thisEventDescription = EventDescription)) Then If NOT (EventDescription = "") Then EventDescription = EventDescription & "
" End If EventDescription = EventDescription & thisEventDescription End If EventPlaceGroupName = mUnNull(SELECTEvents("GroupName")) EventPlaceName = mUnNull(SELECTEvents("ItemName")) EventPlaceURL = mUnNull(SELECTEvents("ItemURL")) If (EventPlaceURL = "http://") Then EventPlaceURL = "" End If Select Case FilterType Case "Organizations" EventFilter = mUnNull(SELECTEvents("Option1")) Case "Categories" EventFilter = mUnNull(SELECTEvents("Option1")) Case "Locations" EventFilter = mUnNull(SELECTEvents("GroupName")) End Select ' limit repeat listings, when appropriate If (hideDatesFlag = "True") Then If NOT (InStr(EventSeriesListed, "," & EventSeriesID & ",") > 0) Then showListingEntry = "True" Else showListingEntry = "False" End If Else showListingEntry = "True" End If If (showListingEntry = "True") Then sLoopSource = sLoopSource & Chr(13) & "

" If NOT (FilterType = "") Then If NOT (EventFilter = FilterHeading) Then If (sFilterHeadingSpacer = "True") Then sLoopSource = sLoopSource & " 

" End If End If End If eventDTStart = Left(EventStart, Len(EventStart) - 3) ' Response.Write("
EventStart = " & EventStart) ' Response.Write("
eventDTStart = " & eventDTStart) eventDTEnd = Left(EventEnd, Len(EventEnd) - 3) ' Response.Write("
EventFilter = " & EventFilter) eventDTStart = DateAdd("s", eventDTStart - (240 * 60), sServerUEStart) eventDTEnd = DateAdd("s", eventDTEnd - (240 * 60), sServerUEStart) eventDStart = FormatDateTime(eventDTStart, 1) ' Response.Write("
DateHeading = " & DateHeading) ' Response.Write("
eventDStart = " & eventDStart) If NOT (eventDStart = DateHeading) Then DateHeading = eventDStart If NOT (hideDatesFlag = "True") Then ' was: sLoopSource = sLoopSource & Chr(13) & "" & eventDStart & "

" & Chr(13) & "

" sLoopSource = sLoopSource & Chr(13) & "

" & Chr(13) & "

" End If End If eventTStart = FormatDateTime(eventDTStart, 3) eventTEnd = FormatDateTime(eventDTEnd, 3) eventTStart = Left(eventTStart, Len(eventTStart) - 6) & Right(eventTStart, 3) eventTEnd = Left(eventTEnd, Len(eventTEnd) - 6) & Right(eventTEnd, 3) If NOT (FilterType = "") Then If NOT (EventFilter = FilterHeading) Then FilterHeading = EventFilter sFilterHeadingSpacer = "True" sLoopSource = sLoopSource & Chr(13) & "" & EventFilter & "

" & Chr(13) & "

" End If End If If NOT ((FilterValue = "Performances") OR (FilterValue = "Screenings")) Then ' begin place name listing If NOT (InStr(EventSeriesListed, "," & EventSeriesID & ",") > 0) Then sLoopSource = sLoopSource & Chr(13) & "" & Chr(13) End If If (whichEventID = "") Then If NOT (doWhat = "phoenixListing") Then If (doWhat = "cacheListing") Then sLoopSource = sLoopSource & Chr(13) & "" Else sLoopSource = sLoopSource & Chr(13) & "" End If End If Else If NOT (EventPlaceURL = "") Then sLoopSource = sLoopSource & Chr(13) & "" End If End If sLoopSource = sLoopSource & "" & EventPlaceName & "" If (((whichEventID = "") OR (NOT (EventPlaceURL = ""))) AND NOT (doWhat = "phoenixListing")) Then sLoopSource = sLoopSource & "" End If If NOT (hideDatesFlag = "True") Then If NOT ((eventTStart = "5:00 AM") AND (eventTEnd = "5:00 AM")) Then sLoopSource = sLoopSource & Chr(13) & "  " & " - " End If End If sLoopSource = sLoopSource & Chr(13) & "
" ' end place name listing End If ' begin event name listing If (whichEventID = "") Then If NOT (doWhat = "phoenixListing") Then sLoopSource = sLoopSource & Chr(13) & "" End If Else If NOT (EventSeriesURL = "") Then sLoopSource = sLoopSource & "" End If End If sLoopSource = sLoopSource & "" & EventName & "" If (((whichEventID = "") OR (NOT (EventSeriesURL = ""))) AND NOT (doWhat = "phoenixListing")) Then sLoopSource = sLoopSource & "" End If ' end event name listing If ((FilterValue = "Performances") OR (FilterValue = "Screenings")) Then ' begin place name listing sLoopSource = sLoopSource & "
" & Chr(13) If NOT (InStr(EventSeriesListed, "," & EventSeriesID & ",") > 0) Then sLoopSource = sLoopSource & "" End If If (whichEventID = "") Then sLoopSource = sLoopSource & "" Else If NOT (EventPlaceURL = "") Then sLoopSource = sLoopSource & "" End If End If sLoopSource = sLoopSource & "" & EventPlaceName & "" If ((whichEventID = "") OR (NOT (EventPlaceURL = ""))) Then sLoopSource = sLoopSource & "" End If sLoopSource = sLoopSource & Chr(13) & "  " If NOT (hideDatesFlag = "True") Then If NOT ((eventTStart = "5:00 AM") AND (eventTEnd = "5:00 AM")) Then sLoopSource = sLoopSource & " - " End If End If ' end place name listing End If ' Response.Write("
EventID = " & EventID) ' Response.Write("
EventFree = " & EventFree) If ((EventFree = "True") OR (EventNew = "True") OR (EventHandicapAccess = "True") OR (NOT ((EventMap = "False") OR (EventMap = "")))) Then sLoopSource = sLoopSource & " " End If If (EventFree = "True") Then sLoopSource = sLoopSource & "  & Chr(34) & " If ((EventNew = "True") OR (EventHandicapAccess = "True") OR (NOT ((EventMap = "False") OR (EventMap = "")))) Then sLoopSource = sLoopSource & " | " End If End If If (EventHandicapAccess = "True") Then sLoopSource = sLoopSource & " & Chr(34) & " If ((NOT ((EventMap = "False") OR (EventMap = "")))) Then sLoopSource = sLoopSource ' & " | " End If End If ' If NOT ((EventMap = "False") OR (EventMap = "")) Then ' sLoopSource = sLoopSource & " & Chr(34) & " ' End If If ((EventFree = "True") OR (EventNew = "True") OR (EventHandicapAccess = "True") OR (NOT ((EventMap = "False") OR (EventMap = "")))) Then sLoopSource = sLoopSource & Chr(13) & "" End If sLoopSource = sLoopSource & Chr(13) & "
" & Chr(13) ' list the description only with the first entry of a series in the listing ' - only for print-friendly/details display or phoenixListing If ((whichEventID = "") AND NOT (doWhat = "phoenixListing")) Then ' strip description for first if first chars are "" If (LCase(Left(EventDescription, 3)) = "") Then ' Response.Write("
EventDescription = " & EventDescription) EventDescription = Left(EventDescription, InStr(LCase(EventDescription), "
") + 4) Else EventDescription = "" End If sLoopSource = sLoopSource & "
" & Chr(13) & "" & EventDescription & "" End If If ((NOT (whichEventID = "")) OR (doWhat = "phoenixListing")) Then If NOT (InStr(EventSeriesListed, "," & EventSeriesID & ",") > 0) Then ' strip description of first if first chars are "" If (LCase(Left(EventDescription, 3)) = "") Then ' Response.Write("
EventDescription = " & EventDescription) EventDescription = Right(EventDescription, Len(EventDescription) - InStr(LCase(EventDescription), "
") - 4) End If sLoopSource = sLoopSource & "

" & Chr(13) & "" & EventDescription & "" & Chr(13) & "

" Else sLoopSource = sLoopSource & "Description" End If End If sLoopSource = sLoopSource & Chr(13) & "" & Chr(13) If (sFileGeneration = "False") Then Response.Write(sLoopSource) sLoopSource = "" Response.flush Else Response.Write("
loop, " & DateHeading & " " & EventPlaceName & ", " & FormatDateTime(Now())) Response.flush End If End If If NOT (whichEventID = "") Then sLoopSource = sLoopSource & "

" & Chr(13) & "

" & Chr(13) & "" & Chr(13) & "One of over one hundred events in the 2003 Boston Cyberarts Festival. For more information go to: www.bostoncyberarts.org or call 617 524-8495." & Chr(13) & "" & Chr(13) & "
" & Chr(13) & "

" End If ' track which series have been listed so far, in order to limit the display of descriptions and entries EventSeriesListed = EventSeriesListed & EventSeriesID & "," If (numEvent Mod 10 = 0) Then timeWhere = timeWhere & FormatDateTime(Now(), 3) & " numEvent = " & numEvent & " loop ends

" End If sListingSource = sListingSource & sLoopSource SELECTEvents.MoveNext Loop numEvents = numEvent ' Response.Write("
numEvents = " & numEvents) timeWhere = timeWhere & FormatDateTime(Now(), 3) & " numEvents = " & numEvents & " end selection loop

" If (numEvents > 0) Then ' For numEvent = 1 to numEvents ' Next Else sListingSource = sListingSource & Chr(13) & "

No events for " & FilterValue & "

" & Chr(13) End If timeWhere = timeWhere & FormatDateTime(Now(), 3) & " end page

" sListingSource = sListingSource & notimeWhere & Chr(13) & Chr(13) & "" & Chr(13) & "" If (sFileGeneration = "False") Then Response.Write(sListingSource) sListingSource = "" Response.flush Else Response.Write("
.") Response.flush End If If (doWhat = "cacheListing") Then ' write sListingSource out to CEventsListing.html ' create new file Set objTxt = objFSO.OpenTextFile("f:\cyberarts_skybuilders_com\bca2003\CEventsListing.html", ForWriting, True, TriStateASCII) ' write initial text into new file objTxt.Write(sListingSource) objTxt.Close Response.Write("Cache listing complete. File CEventsListing.html written.") End If If (doWhat = "phoenixListing") Then ' write sListingSource out to phoenixListing.html ' create new file Set objTxt = objFSO.OpenTextFile("f:\cyberarts_skybuilders_com\bca2003\phoenixListing.html", ForWriting, True, TriStateASCII) ' write initial text into new file objTxt.Write(sListingSource) objTxt.Close Response.Write("Phoenix listing complete. File phoenixListing.html written.") End If ' END RESPONSE ****************************************************************** ' END SERVER LOGIC ************************************************************** ' SERVER CLEANUP **************************************************************** ' END SERVER CLEANUP ************************************************************ ' Copyright � 2001-2003 skyBuilders.com All Rights Reserved. ' Registered skyBuilders developers have a non-exclusive license to use parts of this code in any of their work. They may not sell the entire work or part of it as "timeLines" itself, without written permission from skyBuilders.com. %>