<%@ Language=VBScript %> <% Option Explicit %> <% Response.Buffer = true%> <% dim BadWords, disc_lnpg, disc_pgno, ForwardEMail, Site, Topic, Title, Use_Table ' This controls how many messages will be displayed. If there are more messages ' than the number you specify, the server will add buttons to allow navigating ' between "pages". This is the number of comments to display per page. disc_lnpg = 20 ' What is the name of your site? By name, I mean, take the middle part, between ' the www. and the .com and use it. In other words, the site name for ' www.Microsoft.com would be "Microsoft" Site = "AcidNine" ' What is the topic for this discussion. The default here is "Guest Book". ' You can make it whatever you want - it is invisible to the user. It just ' used so you can later re-organize things. Topic = "Guest Book" ' Display the comments in a table, as rows and columns, or not in a table, like ' paragraphs. Use_Table = "No" ' This can be used to have the web server send you an email each time a new ' comment is added. To use it, enter a valid email address. If you'd like ' the message delivered to more than one address, separate the addresses ' with commas. ForwardEMail = "Rob@AcidNine.com, Mike@AcidNine.com" ' Use this to filter out comments with unacceptable words, per your ' criteria. Simply list the words or phrases separated by commas BadWords = "ddddddddd" %>
TARGET="_self" METHOD=POST>
Name:
E-Mail:
Comments:


<% Discussion %> <% sub Discussion dim rs, mail dim RowNum, x, y, z dim Fld, S dim disc_EnvKey, disc_first_lbl, disc_last_lbl, disc_next_lbl, disc_prev_lbl ' Perform update as necessary if (Request("Submit_Comments") <> "") then if (Request.form.item("Comments") <> "") then on Error resume next x = objDisc.Add(Site, Topic, Request.form.item("Comments"), _ Request.form.item("User_Name"), _ Request.form.item("E_Mail"), _ Request.ServerVariables("Remote_Host")) if Err.number <> 0 then Response.Write("Error #" & Err.Number & ", " & _ Err.Description & "
" & vbcrlf) Response.Write(Err.Source & "
" & vbcrlf) elseif (ForwardEMail <> "") then dim Mail,SmtpServer set mail = Server.CreateObject("CDO.Message") SMTPServer = "Server-05.MorganSys.net" mail.AutoGenerateTextBody = 1 mail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer mail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 mail.Configuration.Fields.Update mail.Fields.update mail.From = "Discussions@" & LTrim(RTrim(Request.ServerVariables("HTTP_Host"))) mail.To = ForwardEMail mail.Subject = Topic & " comments added to " & Site mail.HTMLBody = "The following comments were just added:" & vbcrlf & vbcrlf & _ "Name: " & Request.form.item("User_Name") & vbcrlf & _ "E Mail: " & Request.form.item("E_Mail") & vbcrlf & _ "Comments: " & Request.form.item("Comments") & vbcrlf & _ "" 'mail.TextBody = Msg_Text mail.send set mail = nothing if Err.Number <> 0 then Response.write("An error occurred attempting to send " & _ "your email. Please contact the systems " & _ "administrator
") end if end if on error goto 0 end if end if disc_EnvKey = Request.ServerVariables("PATH_INFO") & "#disc_page"' set rs = objDisc.List(0, Site, Topic, BadWords) if rs.eof then response.write("No Discussion Records..." & vbcrlf) elseif Err.number <> 0 then Response.Write("Error #" & Err.Number & ", " & _ Err.Description & "
" & vbcrlf) Response.Write(Err.Source & "
" & vbcrlf) elseif rs.state <> 0 then Response.Write("" & vbcrlf) Response.Write(vbTab & "" & vbcrlf & _ vbTab & vbTab & "" & vbcrLF) for each fld in rs.fields if (fld.Name <> "Comments") then Response.Write(vbTab & vbTab & vbTab & _ "" & vbcrlf) next Response.Write(vbTab & vbTab & "" & vbcrlf & _ vbTab & "" & vbcrlf) Response.Write(vbTab & "" & vbcrlf) else Response.Write("border=0 cellpadding=0>" & vbcrlf) end if disc_pgno = 1 if (Session(disc_EnvKey) <> "") then disc_pgno = Session(disc_EnvKey) if disc_pgno > rs.PageCount then disc_pgno = 1 end if if (disc_lnpg > 0) and (rs.RecordCount > disc_lnpg) then rs.PageSize = disc_lnpg disc_first_lbl = " |< " disc_next_lbl = " -> " disc_prev_lbl = " <- " disc_last_lbl = " >| " if not IsNull(Request("disc_page_move")) then select case Request("disc_page_move") case "" ' do nothing case disc_first_lbl disc_pgno = 1 case disc_next_lbl disc_pgno = disc_pgno + abs(rs.PageCount > disc_pgno) case disc_prev_lbl disc_pgno = disc_pgno - abs(disc_pgno > 1) case disc_last_lbl disc_pgno = rs.PageCount case else ' do nothing end select else disc_pgno = 1 end if if (disc_pgno = 1) then disc_first_lbl = " " if (disc_pgno = rs.PageCount) then disc_next_lbl = " " if (disc_pgno = 1) then disc_prev_lbl = " " if (disc_pgno = rs.PageCount) then disc_last_lbl = " " Response.Write(vbtab & "" & vbcrlf & vbTab & vbTab & _ "" & _ vbCRLF) Response.Write(vbTab & "" & vbcrlf) else disc_lnpg = 999999999 end if rs.AbsolutePage = disc_pgno session(disc_EnvKey) = disc_pgno rownum = 0 do while (not rs.eof) and (rownum < disc_lnpg) Response.Write(vbTab & "" & vbcrlf) if (Use_Table <> "Yes") then Response.Write(vbTab & vbTab & "" & vbcrlf) else Response.Write(vbtab & vbtab & vbtab & "
" & vbcrlf) end if next if (Use_Table <> "Yes") then Response.Write(vbTab & vbTab & vbTab & "

" & _ vbcrlf & vbTab & vbTab & "" & vbCrLF) end if Response.Write(vbTab & "" & vbCrLf) rs.moveNext rownum = rownum + 1 loop if (Use_Table = "Yes") then Response.Write(vbTab & "" & vbcrlf) end if Response.Write("
" & vbcrlf) else Response.Write(vbTab & vbTab & vbTab & _ "" & vbcrlf) end if Response.Write(vbTab & vbTab & vbTab & vbTab & _ "" & vbcrlf) Response.Write(vbTab & vbTab & vbTab & vbTab & _ RTrim(fld.name) & "" & vbcrlf) Response.Write(vbTab & vbTab & vbTab & "
" & vbcrlf) Response.Write(vbtab & vbtab & vbTab & _ "
" & vbcrlf) Response.Write(vbTab & vbTab & vbTab & "" & vbcrlf) Response.Write(vbTab & vbTab & vbTab & "" & vbcrlf) Response.Write(vbTab & vbTab & vbTab & "" & vbcrlf) Response.Write(vbTab & vbTab & vbTab & "" & vbcrlf) Response.Write(vbTab & vbTab & vbTab & " [" & disc_pgno & "/" & _ rs.PageCount & "] " & vbcrlf & vbTab & vbTab & _ vbTab & "
" & vbcrlf & vbTab & vbTab & "
" & vbcrlf & _ vbtab & vbtab & vbtab & _ "

" & vbcrlf) end if for each fld in rs.fields if (Use_Table = "Yes") then Response.Write(vbTab & vbTab & "

" & _ vbcrlf) else Response.Write(vbTab & vbTab & vbTab & "" & _ Fld.Name & " : " & vbcrlf) end if x = 1 y = len(fld.Value) do while (x <= y) S = "" z = x do while (z <= y) and (((z - x) < 50) or _ (mid(fld.Value, z, 1) <> " ")) if (asc(mid(fld.Value, z, 1)) < 32) then S = S & " " else S = S & mid(fld.Value, z, 1) end if z = z + 1 loop x = z + 1 S = RTrim(S) Response.write(vbtab & vbtab & vbTab & _ S & vbcrlf) loop if (Use_Table = "Yes") then Response.Write(vbtab & vbtab & vbtab & " " & vbcrlf) Response.Write(vbtab & vbtab & "
" & vbcrlf) end if Set rs = nothing end sub function BuildErrorMessage() g_strError = g_strError & "

Actual Error Message:
" & Err.description & "

" g_strError = g_strError & "

Source/Call Stack:
" & Err.source & "

" g_strError = g_strError & "


" end function %>