%@ LANGUAGE="VBSCRIPT" %> <% '-------------------------------------------------------------------------------------------------------- ' The Ultimate Guest Book V1.2 ' a simple but highly configurable guest book that merges seamlessly into just about any design. '-------------------------------------------------------------------------------------------------------- '-------------------------------------------------------------------------------------------------------- ' (c) By Hallmann Web Design 2003 ' Do not copy or distribute without written permission from Hallmann Web Design ' hwd@triad.rr.com '-------------------------------------------------------------------------------------------------------- '--------------------------------------------------------------------------------------------------------- ' Do Not Edit Anything Below Here!!!!!-------------------------------------------------------------------- '--------------------------------------------------------------------------------------------------------- ' Variable declaration Dim strConnectionString Dim cnn Dim rstGuest Dim strSQL Dim Error Dim Template Dim Aktion Dim GuestEntry Dim MenuItem Dim Temp Dim HeadLineFont Dim HeadLineColor Dim HeadLineSize Dim SubTitleFont Dim SubTitleColor Dim SubTitleSize Dim MenuFont Dim MentColor Dim MenuSize Dim FontFace1 Dim FontSize1 Dim FontColor1 DIm FontFace2 Dim FontSize2 Dim FontColor2 Dim FontEnd Dim FormStart Dim SubmitButton Dim ClearButton Dim FormEnd Dim PageNumber Dim Navigation_Class if (Class_Navigation <> "") then Navigation_Class = " class=" & chr(34) & Class_Navigation & chr(34) End If FormStart = "
" HeadLineFont = "" HeadLineColor = "" HeadLineSize = "" SubTitleFont = "" SubTitleColor = "" SubTitleSize = "" MenuFont = "" MenuColor = "" MenuSize = "" FontFace1 = "" FontColor1 = "" FontSize1 = "" FontFace2 = "" FontColor2 = "" FontSize2 = "" FontEnd = "" '------------------------------------- ' Open the connection to the database '------------------------------------- Sub OpenConnection (Error) Set cnn = Server.CreateObject("ADODB.Connection") On Error Resume Next cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataBaseLocation cnn.Open If (Err.Number <> 0) then PrintError Err.Number, "An error has accured when opening the main database" Error = Err.Number Exit Sub End If End Sub '------------------- ' get the recordset '------------------- Sub OpenDataBase(strSQL, CursorType, LockType, Error) OpenConnection Error If (Error <> 0) then Exit Sub Set rstGuest = Server.CreateObject("ADODB.Recordset") rstGuest.Open strSQL, cnn, CursorType, LockType End Sub '-------------------- ' close the database '-------------------- Sub CloseDataBase() rstGuest.Close cnn.Close set cnn = Nothing set rstGuest = Nothing End Sub '------------------------------------------------------------------ ' This function opens a file and returns the contents of the file. '------------------------------------------------------------------ Function ReadFile(txtFile, Error) Dim txtTemp, objFS, objFL Error = 0 On Error Resume Next Set objFS = CreateObject("Scripting.FileSystemObject") On Error Resume Next Set objFL = objFS.OpenTextFile(txtFile) If (Err.Number <> 0) then Error = Err.Number Exit Function End If Do While Not objFL.AtEndOfStream txtTemp = txtTemp & objFL.ReadLine txtTemp = txtTemp & vbCrLf Loop objFL.Close Set objFS = Nothing ReadFile = txtTemp Error = Err.Number End Function '----------------- ' Print ErrorPage '----------------- Sub PrintError(ErrorNumber, Text) %>| " Else GuestEntry = GuestEntry & VBCrLF & " | |||
| " End If GuestEntry = GuestEntry & VBCrLf & FormStart GuestEntry = GuestEntry & FontFace1 & FontColor1 & FontSize1 & "Name:" & FontEnd GuestEntry = GuestEntry & " | " & " " GuestEntry = GuestEntry & " | ||
| " Else GuestEntry = GuestEntry & " | |||
| " End If GuestEntry = GuestEntry & FontFace1 & FontColor1 & FontSize1 & "From:" & FontEnd GuestEntry = GuestEntry & " | " & VBCrLf GuestEntry = GuestEntry & "" & " " GuestEntry = GuestEntry & " | ||
| " Else GuestEntry = GuestEntry & " | |||
| " End If GuestEntry = GuestEntry & FontFace1 & FontColor1 & FontSize1 & "eMail:" & FontEnd GuestEntry = GuestEntry & " | " & VBCrLf GuestEntry = GuestEntry & "" & " " GuestEntry = GuestEntry & " | ||
| " Else GuestEntry = GuestEntry & " | |||
| "
End If
GuestEntry = GuestEntry & FontFace1 & FontColor1 & FontSize1 & "Web Site: ( include http:// )" & FontEnd GuestEntry = GuestEntry & " | " & VBCrLf
GuestEntry = GuestEntry & "" & " " GuestEntry = GuestEntry & " | ||
| " Else GuestEntry = GuestEntry & " | |||
| " End If GuestEntry = GuestEntry & FontFace1 & FontColor1 & FontSize1 & "Comment:" & FontEnd GuestEntry = GuestEntry & " | " & VBCrLf GuestEntry = GuestEntry & "" & "" GuestEntry = GuestEntry & " | ||
" End If GuestEntry = GuestEntry & "" GuestEntry = GuestEntry & SubmitButton & " " & ClearButton & FormEnd GuestEntry = GuestEntry & " | |||
"
Else
GuestEntry = GuestEntry & VBCrLF & "| "
End If
GuestEntry = GuestEntry & VBCrLf
If (rstGuest("Name") <> "") then
GuestEntry = GuestEntry & FontFace1 & FontColor1 & FontSize1 & rstGuest("Date") & " - " & rstGuest("Time") & FontEnd & " | " & VBCrLf If (rstGuest("From") <> "") then GuestEntry = GuestEntry & FontFace1 & FontColor1 & FontSize1 & rstGuest("Name") & " from " & rstGuest("From") & " had the following comment: " & FontEnd & VBCrLf Else GuestEntry = GuestEntry & FontFace1 & FontColor1 & FontSize1 & rstGuest("Name") & " had the following comment: " & FontEnd & VBCrLf End If End If If (RowColor2 = "") then GuestEntry = GuestEntry & VBCrLF & " "
Else
GuestEntry = GuestEntry & VBCrLF & " | "
End If
GuestEntry=GuestEntry & " | " If (rstGuest("Comment") <> "") then GuestEntry = GuestEntry & FontFace2 & FontColor2 & FontSize2 & rstGuest("Comment") & "" GuestEntry = GuestEntry & VBCrLF & " |