<% '################################################################################# '## Copyright (C) 2000 Michael Anderson '## '## This program is free software; you can redistribute it and/or '## modify it under the terms of the GNU General Public License '## as published by the Free Software Foundation; either version 2 '## of the License, or any later version. '## '## All copyright notices regarding Snitz Forums 2000 '## must remain intact in the scripts and in the outputted HTML '## The "powered by" text/logo with a link back to '## http://forum.snitz.com in the footer of the pages MUST '## remain visible when the pages are viewed on the internet or intranet. '## '## This program is distributed in the hope that it will be useful, '## but WITHOUT ANY WARRANTY; without even the implied warranty of '## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '## GNU General Public License for more details. '## '## You should have received a copy of the GNU General Public License '## along with this program; if not, write to the Free Software '## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '## '## Support can be obtained from support forums at: '## http://forum.snitz.com '## '## Correspondence and Marketing Questions can be sent to: '## reinhold@bigfoot.com '## '## or '## '## Snitz Communications '## C/O: Michael Anderson '## PO Box 200 '## Harpswell, ME 04079 '################################################################################# '--------------------------------------------------------------------------------------- 'Name Of File : events.asp 'Author : Alan Le (alan@iamviet.com) 'Originally : WriteMonth function and WriteTD functionality based on ASPCalendar by Kamath (www.kamath.com) 'Add-Ons and fixes : Huwr, Richard Kinser, 'Description : Ads Detail Page ' Classified Ads Mod for Snitz Forum 3.1 sr 4 'Created : 1/01/2001 'Modifications ' mm/dd/yyyy - : ' 1) : 1/20/2001 ' Huwr converted dates to use system dates and added private events. ' 2) : 1/31/2001 ' Alan re-release with new functionalities. '--------------------------------------------------------------------------------------- %> <% ' sets who is allowed to add events dim intAllowed 'intAllowed = 1 'Any members intAllowed = 3 'Only Moderators and Admin 'intAllowed = 4 'Admins Only intDisplay = 15 'The number of events to display in upcoming events and recent events of events.asp ' Constants for the days of the week Const cSUN = 1, cMON = 2, cTUE = 3, cWED = 4, cTHU = 5, cFRI = 6, cSAT = 7 dim intPrivateEvent '###################### strSelectSize = Request.Form("SelectSize") if strSelectSize = "" or IsNull(strSelectSize) then strSelectSize = Request.Cookies( strCookieURL & "strSelectSize") end if if not(IsNull(strSelectSize)) then Response.Cookies(strCookieURL & "strSelectSize") = strSelectSize Response.Cookies(strCookieURL & "strSelectSize").expires = Now() + 365 end if select case strSelectSize case "1" intCols = 45 intRows = 6 case "2" intCols = 80 intRows = 12 case "3" intCols = 90 intRows = 12 case "4" intCols = 130 intRows = 15 case else intCols = 45 intRows = 6 end select '###################### if Request.Form("isPrivateEvent") = "1" then intPrivateEvent = 1 else intPrivateEvent = 0 end if %> <% ' Get the name of this file dim sScript sScript = Request.ServerVariables("SCRIPT_NAME") 'set the date to today dim datToday datToday = date() 'get the date from querystring or form if there is one myDate = Request.QueryString("date") ' Check for valid month input dim intThisMonth if myDate <> "" then intThisMonth = month(myDate) else intThisMonth = Request.QueryString("month") end if 'set current month if intThisMonth = "" then intThisMonth = month(datToday) else intThisMonth = cint(intThisMonth) end if 'constrain to only valid months If intThisMonth < 1 OR intThisMonth > 12 Then intThisMonth = Month(datToday) End If ' Check for valid year input dim intThisYear if myDate <> "" then intThisYear = year(myDate) else intThisYear = Request.QueryString("year") end if 'set current year If intThisYear = "" Then intThisYear = Year(datToday) else intThisYear = cint(intThisYear) End If dim sSQL dim sStart_Date, sEnd_Date, sEvent_title, sEvent_Details 'set the mode dim sMode, berror sMode = Request.QueryString("mode") select case sMode case "delete" if mlev >= intAllowed then sSQL = "DELETE FROM " & strTablePrefix & "EVENTS WHERE Event_ID=" & Request.QueryString("Event_ID") my_Conn.Execute ssql strCMessage = strEventDeleted end if case "aggiorna" if mlev >= intAllowed then sMode = "edit" strCMessage = strEventEdited end if case "aggiungi" if mlev >= intAllowed then smode = "add" end if end select if Request.Form("EVENT") <> "" then Update_Event(Request.Form("EVENT")) end if dim ddate dDate = myDate If not IsEmpty(ddate) and IsDate(ddate) and smode = "" Then sMode = "display" end if dim strMonthName, datFirstDay, intFirstWeekday, intLastDay, intPrevMonth, intNextMonth, intPrevYear, intNextYear dim LastMonthDate, NextMonthDate, intPrintDay, intLastMonth, dToday, dFirstDay, dLastDay, endrows, intLoopDay dim bevents, i, sTitle %>
 <% =strAllForums %>
 <% =strCalendarOfEvents %>
<%DisplayMonth_small()%> <% if mlev >= intAllowed then%> <% end if%> <% if Request.QueryString("view") <> "week" then %> <% end if%> <% if smode <> "" then%> <% end if%>
<% =strViewByMonth %>
BORDER="0" WIDTH="35" HEIGHT="20">
"><% =strAddEvent %>
"><% =strViewByWeek %>
 
<% =strUpcomingEvents %>
<% Call DisplayUpcomingEvents %>
<% =strRecentEvents %>
<% call DisplayPastEvents %>

<% if smode = "" then DisplayMonth_full else if Request.QueryString("view") = "week" then DisplayWeek else %>
<% DisplayEvents() %>

<% =strViewbyMonth %>
<% end if end if%>