<% @ Language=VBScript %> <% Option Explicit %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Guide - Web Wiz Forums '** http://www.webwizforums.com '** '** Copyright 2001-2006 Bruce Corkhill All Rights Reserved. '** '** This program is free software; you can modify (at your own risk) any part of it '** under the terms of the License that accompanies this software and use it both '** privately and commercially. '** '** All copyright notices must remain in tacked in the scripts and the '** outputted HTML. '** '** You may use parts of this program in your own private work, but you may NOT '** redistribute, repackage, or sell the whole or any part of this program even '** if it is modified or reverse engineered in whole or in part without express '** permission from the author. '** '** You may not pass the whole or any part of this application off as your own work. '** '** All links to Web Wiz Guide and powered by logo's must remain unchanged and in place '** and must remain visible when the pages are viewed unless permission is first granted '** by the copyright holder. '** '** This program is distributed in the hope that it will be useful, '** but WITHOUT ANY WARRANTY; without even the implied warranty of '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER '** WARRANTIES WHETHER EXPRESSED OR IMPLIED. '** '** You should have received a copy of the License along with this program; '** if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom. '** '** '** No official support is available for this program but you may post support questions at: - '** http://www.webwizguide.info/forum '** '** Support questions are NOT answered by e-mail ever! '** '** For correspondence or non support questions contact: - '** '** Web Wiz Guide, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, UK, BH15 4JD '** '**************************************************************************************** '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 intForumID 'Holds the forum ID 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 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 & strQsSID2) '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 & strQsSID2) 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 strLinkPage 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 %> <% = strMainForumName %> Takvim: <% = 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 %>
<% 'If RSS XML enabled then display an RSS button to link to XML file If blnRSS Then Response.Write("
 
") %> <% = strMainForumName %><% = strNavSpacer %><% = strTxtCalendar %><% = strNavSpacer %><% = 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 an event is found for this date display it If intYear = Year(sarryEvents(2,intDbArrayLoop)) AND intMonth = Month(sarryEvents(2,intDbArrayLoop)) AND intDay = Day(sarryEvents(2,intDbArrayLoop)) Then 'Read the event details strSubject = sarryEvents(1,intDbArrayLoop) strMessage = sarryEvents(3,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 %>  

<% 'Display the process time If blnShowProcessTime Then Response.Write "

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