<%@ Language=VBScript %> <% Option Explicit %> <% Response.Buffer = true Dim URLTitle, URLMsg, URLDate 'URL Information Dim UserID, UserEmail, UserName, UserCatg 'User Information Dim PageOkay, PageNote, PageInfo, PageXtra 'These MUST be set for each page Dim Keywords 'Not a constant in case modification is required Dim DataPage Dim mMainPrompt Dim iLen, iWhere 'Looping Variable Keywords = "" 'Last time site was updated URLDate = Modified() 'Check if the user is logged-in UserID = CLng(Request.Cookies(COOKIE)("AccountID")) UserEmail = CStr(Request.Cookies(COOKIE)("Email")) UserName = CStr(Request.Cookies(COOKIE)("FullName")) UserCatg = CStr(Request.Cookies(COOKIE)("Category")) URLTitle = Trim(Request.QueryString("URL")) If URLTitle = "" Then 'If the page is Default then there is a problem 'Moral of the story - give pages meaningful names URLTitle = CStr(Request.ServerVariables("SCRIPT_NAME")) 'Strip off unwanted text eg: /News/About.asp = About Do Until InStr(URLTitle, "/SafeWorX/") = 0 iLen = Len(URLTitle) iWhere = InStr(URLTitle, "/SafeWorX/") URLTitle = Right(URLTitle, iLen - iWhere) Loop 'Strip off extension URLTitle = Left(URLTitle, Len(URLTitle) - 4) End If Function Browser(Capability) Dim oBrowser Set oBrowser = Server.CreateObject("MSWC.BrowserType") Select Case UCase(Capability) Case "TABLES": Browser = oBrowser.Tables Case "FRAMES": Browser = oBrowser.Frames Case "JAVA": Browser = oBrowser.JavaApplets Case "COOKIES": Browser = oBrowser.Cookies Case "ACTIVEXCONTROLS": Browser = oBrowser.ActiveXControls Case "BACKGROUNDSOUNDS": Browser = oBrowser.BackgroundSounds Case "JAVASCRIPT": Browser = oBrowser.JavaScript Case "VBSCRIPT": Browser = oBrowser.VBScript Case Else: Browser = False End Select Set oBrowser = Nothing End Function Function PrepSQL(SQL) PrepSQL = Replace(SQL, Chr(39), "''") End Function Function SQLDate(InDate) If IsDate(InDate) Then If Application("DBType") = "SQL" Then SQLDate = "'" SQLDate = SQLDate & CStr(Month(InDate)) & "/SafeWorX/" SQLDate = SQLDate & CStr(Day(InDate)) & "/SafeWorX/" SQLDate = SQLDate & CStr(Year(InDate)) SQLDate = SQLDate & "'" ElseIf Application("DBType") = "ACCESS" Then SQLDate = "#" & InDate & "#" Else SQLDate = InDate End If End If End Function Function DSN() 'Do not forget to add the password DSN = Application("DSN") End Function 'Provide a Disconnected Editable RecordSet Function GetRS(RS, SQL) Set GetRS = Server.CreateObject("ADODB.RecordSet") With GetRS .CursorLocation = adUseClient .CursorType = adOpenStatic .LockType = adLockOptimistic .Open SQL, DSN Set .ActiveConnection = Nothing End With Set RS = GetRS Set GetRS = Nothing End Function 'Provide a Disconnected ReadOnly RecordSet Function GetRO(RS, SQL) Set GetRO = Server.CreateObject("ADODB.RecordSet") With GetRO .CursorLocation = adUseClient .CursorType = adOpenStatic .LockType = adLockReadOnly .Open SQL, DSN Set .ActiveConnection = Nothing End With Set RS = GetRO Set GetRO = Nothing End Function Function PutRS(RS) With RS .ActiveConnection = DSN .UpdateBatch Set .ActiveConnection = Nothing End With End Function Function Modified() Dim objFSO Dim objFile Dim dateModified Dim FileName FileName = Request.ServerVariables("Script_Name") ' Creates the object and assigns it to our variable. Set objFSO = Server.CreateObject("Scripting.FileSystemObject") ' Get access to the file Set objFile = objFSO.GetFile(Server.MapPath(FileName)) ' Get last modified property dateModified = objFile.DateLastModified ' You can format it as you like using the FormatDateTime command Modified = FormatDateTime(dateModified, 1) & " at " & FormatDateTime(dateModified, 3) ' Kill our objects Set objFile = Nothing Set objFSO = Nothing End Function %>