<% @ Language=VBScript %> <% Option Explicit %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Forums(TM) '** http://www.webwizforums.com '** '** Copyright (C)2001-2008 Web Wiz(TM). All Rights Reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwizguide.com/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwizguide.com '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** '*************************** SOFTWARE AND CODE MODIFICATIONS **************************** '** '** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE '** AGREEMENT AND IS STRICTLY PROHIBITED '** '** If you wish to modify any part of this software a license must be purchased '** '**************************************************************************************** 'Set the response buffer to true as we maybe redirecting Response.Buffer = True 'Make sure this page is not cached Response.Expires = -1 Response.ExpiresAbsolute = Now() - 2 Response.AddHeader "pragma","no-cache" Response.AddHeader "cache-control","private" Response.CacheControl = "No-Store" 'Dimension variables Dim sarryEvents 'Holds the event recordset in an array Dim saryBirthdays 'Holds the birthdays recordset in an array Dim strSubject 'Holds the event subject Dim strMessage 'Holds the event message Dim strMonth 'Holds the month name Dim intMonth 'Holds the integer value for the month Dim intYear 'Holds the year Dim intFistDayOfMonth 'Holds the first day of the month as an interger Dim intWeekLoop 'Week Loop counter Dim intDayLoopCounter 'Day loop counter Dim intDay 'Holds the day Dim intMaxNoMonthDays 'Holds total number of days for the month Dim dtmNow 'Holds the present date according to any server off-set Dim intView 'Holds the type of view (1=monh, 2=week, 3=year) Dim dtmDbStartDate 'Holds the database search start date Dim dtmDbEndDate 'Holds the database search end date Dim intDbArrayLoop 'Database array loop counter Dim intNoOfBirthdays 'Holds the number of birthdays Dim intAge 'Holds the age for birthdays Dim strMemBirthdays 'Holds the members birthdays Dim strUserName 'Holds the username of the member with a birthday Dim lngUserProfile 'Holds the user profile number Dim blnShowBirthdays 'Holds if birthdays are hidden or not Dim strPageRedirect 'Holds the page redirect details 'If the calendar system is disabled send the user away If blnCalendar = False OR blnACode Then 'Clean up Call closeDatabase() 'Send to default page Response.Redirect("default.asp" & strQsSID1) End If 'If this is a year view redirect to the year calendar view page If Request.QueryString("V") = "3" Then strPageRedirect = "calendar_year.asp?Y=" & Request.QueryString("Y") If Request.QueryString("DB") <> "" Then strPageRedirect = strPageRedirect & "&DB=" & Request.QueryString("DB") Response.Redirect(strPageRedirect & strQsSID3) 'Else if week view ElseIf Request.QueryString("V") = "2" Then strPageRedirect = "calendar_week.asp?M=" & Request.QueryString("M") & "&Y=" & Request.QueryString("Y") If Request.QueryString("DB") <> "" Then strPageRedirect = strPageRedirect & "&DB=" & Request.QueryString("DB") Response.Redirect(strPageRedirect & strQsSID3) End If 'Intilise variables dtmNow = getNowDate() blnShowBirthdays = CBool(showBirthdays()) intDay = 0 'Read in the year to view If Cint(Request.QueryString("Y")) => 1900 AND Cint(Request.QueryString("Y")) =< Cint(Year(dtmNow)+20) Then intYear = CInt(Request.QueryString("Y")) 'Else use this year as the month to view Else intYear = Year(dtmNow) End If 'Read in the month to view If Cint(Request.QueryString("M")) => 1 AND CInt(Request.QueryString("M")) =< 12 Then intMonth = CInt(Request.QueryString("M")) 'Else use this month as the month to view Else intMonth = Month(dtmNow) End If 'Get the first day of the month (use internation ISO date fomat (yyyy-mm-dd) for server compatibility) intFistDayOfMonth = WeekDay(intYear & "-" & intMonth & "-01") 'Get the number of days in the month intMaxNoMonthDays = getMonthDayNo(intMonth, intYear) 'Get the month in name format strMonth = getMonthName(intMonth) 'Calculate the db serach start date If intMonth = 1 Then dtmDbStartDate = internationalDateTime(intYear-1 & "-12-1") Else dtmDbStartDate = internationalDateTime(intYear & "-" & intMonth-1 & "-1") End If 'Calculate the db serach end date If intMonth = 12 Then dtmDbEndDate = internationalDateTime(intYear+1 & "-01-" & getMonthDayNo(1, intYear+1)) Else dtmDbEndDate = internationalDateTime(intYear & "-" & intMonth+1 & "-" & getMonthDayNo(intMonth+1, intYear)) End If 'SQL Server doesn't like ISO dates with '-' in them, so remove the '-' part If strDatabaseType = "SQLServer" Then dtmDbStartDate = Replace(dtmDbStartDate, "-", "", 1, -1, 1) dtmDbEndDate = Replace(dtmDbEndDate, "-", "", 1, -1, 1) End If 'Place the date in SQL safe # or ' If strDatabaseType = "Access" Then dtmDbStartDate = "#" & dtmDbStartDate & "#" dtmDbEndDate = "#" & dtmDbEndDate & "#" Else dtmDbStartDate = "'" & dtmDbStartDate & "'" dtmDbEndDate = "'" & dtmDbEndDate & "'" End If 'Call the sub procedure to get the events from the database Call getEvents() 'SQL Query Array Look Up table '0 = Topic_ID '1 = Subject '2 = Hide '3 = Event_date '4 = Message 'Call sub to get birthdays from the database If blnDisplayBirthdays AND blnShowBirthdays Then Call getBirthdays(intMonth, 0) 'SQL Query Array Look Up table '0 = Author_ID '1 = Username '2 = DOB Dim intTotalRecordsPages intTotalRecordsPages = 12 Dim intRecordPositionPageNum Dim intPageLinkLoopCounter 'Clean up Call closeDatabase() 'If active users is enabled update the active users application array If blnActiveUsers Then 'Call active users function saryActiveUsers = activeUsers(strTxtViewing & " " & strTxtCalendar, strMonth & " " & intYear, "calendar.asp?Y=" & intYear & "&M=" & intMonth, 0) End If 'Set bread crumb trail strBreadCrumbTrail = strBreadCrumbTrail & strNavSpacer & "" & strTxtCalendar & "" & strNavSpacer & strMonth & " " & intYear 'Status bar tools strStatusBarTools = strStatusBarTools & " " %> <% = strMainForumName & " " & strTxtCalendar & ": " & strMonth & " " & intYear %> <% '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** Response.Write("" & vbCrLf) '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** 'If RSS feed is enabled then have an alt link to it for browers that support RSS Feeds If blnRSS Then Response.Write(vbCrLf & "") %>

<% = strTxtCalendar & ": " & strMonth & " " & intYear %>

<< <% = strTxtPrevious %>   <% = strTxtNext %> >>
<% 'Loop through to display the weeks of the month (we use 6 as this is the most required to cover an entire month) For intWeekLoop = 1 TO 6 %> <% 'Display ledger info 'Loop through the 7 days of the week For intDayLoopCounter = 1 TO 7 'Increment the day by 1 If intDay > 0 Then intDay = intDay + 1 'See if this is the first day of the month If intFistDayOfMonth = intDayLoopCounter AND intDay = 0 Then intDay = 1 'Write the table cell Response.Write(vbCrLf & " <% 'If we have run out of weeks in this month exit loop If intMaxNoMonthDays =< intDay Then Exit For Next %>
<% = strMonth & " " & intYear %>
>
>
>
>
1 AND intDay <= intMaxNoMonthDays Then 'If today place a red border around the day If intMonth = Month(dtmNow) AND intDay = Day(dtmNow) AND intYear = Year(dtmNow) Then Response.Write(" class=""calTodayCell""") Else Response.Write(" class=""calDateCell""") End If 'Else the day is not a date in this month Else Response.Write(" class=""calEmptyDateCell""") End If Response.Write(" style=""padding:0px"">") Response.Write("
") 'If this is a day in the month display day number If intDay => 1 AND intDay <= intMaxNoMonthDays Then Response.Write("" & intDay & "") 'Display the day Select Case intDayLoopCounter Case 1 Response.Write(strTxtSun) Case 2 Response.Write(strTxtMon) Case 3 Response.Write(strTxtTue) Case 4 Response.Write(strTxtWed) Case 5 Response.Write(strTxtThu) Case 6 Response.Write(strTxtFri) Case 7 Response.Write(strTxtSat) End Select Response.Write("
") Response.Write("
") 'See if we have an event to display If isArray(saryBirthdays) AND intDay => 1 AND intDay <= intMaxNoMonthDays Then 'Initlise the loop array intDbArrayLoop = 0 intNoOfBirthdays = 0 intAge = 0 strMemBirthdays = "" 'Loop through the events array Do While intDbArrayLoop <= Ubound(saryBirthdays,2) 'If bitrhday is found for this date display it If intMonth = Month(saryBirthdays(2,intDbArrayLoop)) AND intDay = Day(saryBirthdays(2,intDbArrayLoop)) Then 'If we have been around once before then place a comma between the entries If intAge <> 0 Then strMemBirthdays = strMemBirthdays & ", " 'Calculate the age (use months / 12 as counting years is not accurate) (use FIX to get the whole number) intAge = Fix(DateDiff("m", saryBirthdays(2,intDbArrayLoop), intYear & "-" & intMonth & "-" & intDay)/12) 'Place the bitrhdays into a string to show as as title for the link strMemBirthdays = strMemBirthdays & saryBirthdays(1,intDbArrayLoop) & "(" & intAge & ")" 'Initilise variables for the first birthday, it only 1 birthday found we display this data strUserName = saryBirthdays(1,intDbArrayLoop) lngUserProfile = saryBirthdays(0,intDbArrayLoop) 'Increment the number of birthdays intNoOfBirthdays = intNoOfBirthdays + 1 End If 'Move to next array position intDbArrayLoop = intDbArrayLoop + 1 Loop 'Write the HTML for the date 'If 1 birthday display the user birthday If intNoOfBirthdays = 1 Then Response.Write(" " & strUserName & " (" & intAge & ")") 'If more than 1 birhday display the number ElseIf intNoOfBirthdays > 1 Then Response.Write(" " & intNoOfBirthdays & " " & strTxtBirthdays & "") End If End If 'See if we have an event to display If isArray(sarryEvents) AND intDay => 1 AND intDay <= intMaxNoMonthDays Then 'Initlise the loop array intDbArrayLoop = 0 'Loop through the events array Do While intDbArrayLoop <= Ubound(sarryEvents,2) 'If there isn't an end date set, set the end date as the event start date to prevent errors If isDate(sarryEvents(3,intDbArrayLoop)) = False Then sarryEvents(3,intDbArrayLoop) = sarryEvents(2,intDbArrayLoop) 'If an event is found for this date display it If CDate(intYear & "-" & intMonth & "-" & intDay) >= CDate(sarryEvents(2,intDbArrayLoop)) AND CDate(intYear & "-" & intMonth & "-" & intDay) <= CDate(sarryEvents(3,intDbArrayLoop)) Then 'Read the event details strSubject = sarryEvents(1,intDbArrayLoop) strMessage = sarryEvents(4,intDbArrayLoop) 'Remove HTML from message for subject link title strMessage = removeHTML(strMessage, 100, true) 'Trim the subject strSubject = TrimString(strSubject, 25) 'Clean up input to prevent XXS hack strMessage = formatInput(strMessage) strSubject = formatInput(strSubject) 'Place in a
if birthdays are displayed If intNoOfBirthdays > 0 Then Response.Write("
") 'Write the HTML for the event Response.Write(" " & strSubject & "
") End If 'Move to next array position intDbArrayLoop = intDbArrayLoop + 1 Loop End If Response.Write("
") Next %>
<< <% = strTxtPrevious %>   <% = strTxtNext %> >>
<% 'Call the sub procedure to write the calendar If intMonth = 1 Then Call displayMonth(12, intYear-1, 1) Else Call displayMonth(intMonth-1, intYear, 1) End If %> <% 'Call the sub procedure to write the calendar If intMonth = 12 Then Call displayMonth(1, intYear+1, 1) Else Call displayMonth(intMonth+1, intYear, 1) End If %>  

<% '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** If blnLCode = True Then If blnTextLinks = True Then Response.Write("Bulletin Board Software by Web Wiz Forums® version " & strVersion & "") If blnACode Then Response.Write(" [Free Express Edition]") Else Response.Write("") If blnACode Then Response.Write("
Powered by Web Wiz Forums Free Express Edition") End If Response.Write("
Copyright ©2001-2008 Web Wiz") End If '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** 'Display the process time If blnShowProcessTime Then Response.Write "

" & strTxtThisPageWasGeneratedIn & " " & FormatNumber(Timer() - dblStartTime, 3) & " " & strTxtSeconds & "
" %>