<%
Set Conn=Server.createobject("ADODB.Connection")
Conn.Open("CineComments2")
if Request.QueryString("DeleteComment") <> "" then
Set DelRS = Conn.Execute("SELECT * From Comments WHERE CommentID = " & Request.Querystring("DeleteComment"))
if instr(DelRS("IPAddress"),request.serverVariables("REMOTE_HOST")) > 0 then
Conn.Execute("DELETE * From Comments WHERE CommentID = " & Request.Querystring("DeleteComment"))
Response.write "Your comment has been deleted. Close this window to continue."
end if
end if
if Request.Querystring("CommentSubmitted") then
On Error Resume Next
valid = false
BlogID=Request.Form("BlogID")
Title=Replace(Request.Form("Title"), "'", "''")
CommentDate=Now()
Name=Replace(Request.Form("Name"), "'", "''")
If Name = "" then Name = " "
email=Request.Form("email")
If email = "" then email = " "
URL=Request.Form("URL")
if URL = "" then URL = "http://"
IPAddress=Request.ServerVariables("REMOTE_HOST")
Comment=Replace(Request.Form("CommentText"), "'", "''")
Comment=Replace(Comment, vbCrLf, "
")
ArticleLink=Request.Form("Link")
ArticleLink=Replace(ArticleLink, "[hash]", "#")
If ArticleLink="" then ArticleLink="http://www.cinestatic.com/showcomments.asp?BlogID=" & BlogID
if Instr(Lcase(Comment), "http") then valid = false
if valid then
SQLAdd="INSERT INTO Comments(BlogID, Comment, CommentDate, Name, URL, email, Title,IPAddress, Links) "
SQLAdd=SQLAdd&" VALUES ( '"&BlogID&"', '"&Comment&"', '" & CommentDate &"', '"&Name&"', '" &URL&"', '"&email&"', '" & Title & "', '"& IPAddress& " ', '"&ArticleLink&" ' )"
Conn.Execute(SQLAdd)
end if
' NOW WRITE COOKIES
response.cookies("Visitor")("Name") = Name
response.cookies("Visitor")("Email") = Email
response.cookies("Visitor")("URL") = URL
response.cookies("Visitor").Expires = Now() + 500
'SendNotice=-1
if SendNotice then
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "smtpmail.databasepower.net"
Mail.Port = 25 ' Optional. Port is 25 by default
'We can stick whatever email address we WANT in here!! How strange.
Mail.From = "mike[-AT-]cinestatic.com"'"michaelthealien@hotmail.com"
Mail.FromName ="Cinestatic Comments" ' Optional
Mail.AddAddress "mike[-AT-]cinestatic.com", "Mike" '"Mike[-AT-]cinestatic.com"
Mail.AddAddress "bruce[-AT-]cinestatic.com", "Bruce"
'Mail.AddCC Request.Form("Emails")
'Check...
Mail.Subject = "New Comment"
BodyText = "New comment @ " & Title & "
" & ArticleLink & "
"
BodyText = BodyText & "
By "& Name &" (" & email &") - "&URL &"
"
BodyText = BodyText & "
-----------------------------"
BodyText = BodyText & "
[Message generated from Cinestatic Research: www.cinestatic.com]"
Mail.Body = Replace(BodyText, "
", Chr(13) & Chr(10))
Mail.Send
end if
If Err <> 0 Then
' 'Response.Write("Note: This thing has been coming up with errors recently. Most of the time these seem to be completely unwarranted... Check to see whether your comment has appeared before 'obeying the red'.")
' 'ErrDescription = Err.Description
' ' Response.Write "
An error occurred: " & ErrDescription &"
"
' 'If Instr(ErrDescription, "email") then
' ' Response.Write "You need to make sure there's something in the email box, even if it's just a space"
' 'ElseIf Instr(ErrDescription, "URL") then
' ' Response.Write "IF you don't have a website then leave the box with 'http://' in it."
' 'ElseIf Instr(ErrDescription, "Name") then
' ' Response.Write "Please tell me your name! Please! If you're making one up, best make it funny..."
' 'ElseIf Instr(ErrDescription, "server") then
' ' Response.write("Thanks for your comment. Ignore that error above... IT'S FINE!")
' 'Else
' ' Response.Write "There might be a problem with double quote-marks. I can deal with single quotes though (')... Or it could be anything (maybe the server timing out)."
' 'End If
' ' Response.Write " [To go back and correct any problems click here.]
"
Response.Write("Sorry, due to excessive spam, comments on cinestatic have been disabled. Sorry.
")
Else
if valid then
response.write "
Your thoughts have been duly noted.
"
else
response.write "
You have been filtered out as a potential spam suspect. Sorry.
"
end if
End If
end if
BlogID = Request.Querystring("BlogID")
Title = Request.QueryString("Title")
if Title="" then Title=Request.Form("Title")
If Title = "" then Title = BlogID
Link = Request.QueryString("Link")
if Link="" then Link=Request.Form("link")
Response.Write("")
Response.Write("| Comments on " & Title & " | ")
Response.Write("
")
set rs = Conn.Execute("SELECT * From Comments WHERE BlogID='" & BlogID & "' order by CommentID Asc")
do while not rs.eof
CommDt = RS("CommentDate")
Email = Replace(RS("email"), "@", "[-AT-]")
%>