<% Sub zEdit_Comment() '-- add 1 to the comments field in the news post this comment belongs to -- Dim zobjRS,zstrSQL Set zobjRS = Server.CreateObject("ADODB.Recordset") zstrSQL = "SELECT comments.PostedBy, comments.Comment FROM comments WHERE comments.CommentID LIKE " & zintCommentID '-- insert the comment into the database -- zobjRS.Open zstrSQL, zobjConn, adOpenForwardOnly, adLockOptimistic, adCmdText zobjRS("PostedBy") = zstrPostedBy zobjRS("Comment") = zstrComment zobjRS.Update zobjRS.Close Set zobjRS = Nothing zobjConn.Close Set zobjConn = Nothing End Sub '-- get user input -- Dim zstrPostedBy,zstrComment,zintCommentID,zvarAutoUrl,zvarSmilies zstrPostedBy = Trim(Request.Form("postedby")) zstrComment = Trim(Request.Form("comment")) zintCommentID = Trim(Request.Form("commentid")) zvarAutoUrl = Trim(Request.Form("autoparseurl")) zvarSmilies = Trim(Request.Form("parsesmilies")) If LCase(zvarAutoUrl) = "yes" Then zvarAutoUrl = True Else zvarAutoUrl = False End If If Comments_AllowSmilies And LCase(zvarSmilies) = "yes" Then zvarSmilies = True Else zvarSmilies = False End If '-- check postid is a number -- If zintCommentID = "" Or Not IsNumeric(zintCommentID) Then Call Script_Error("Invalid commentid submitted") End If '-- check username If zstrPostedBy = "" Then zstrPostedBy = "Anonymous" Else '-- prepare the name given for database -- If Comments_UseLanguageFilter Then zstrPostedBy = zFilter_Language(zstrPostedBy) End If zstrPostedBy = Server.HTMLEncode(zstrPostedBy) End If If Len(zstrPostedBy) > 50 Then zstrPostedBy = (Left(zstrPostedBy,48) & "..") End If '-- check comment was given -- If zstrComment <> "" Then '-- prepare comment for db -- If Comments_UseLanguageFilter Then zstrComment = zFilter_Language(zstrComment) End If zstrComment = Server.HTMLEncode(zstrComment) zstrComment = zFilter(zstrComment,zvarAutoUrl,Comments_AllowUBB,zvarSmilies,Comments_AllowImages) '-- add comment to db -- Call zEdit_Comment() End If '-- send user back to where they came from -- Response.Redirect "ui_index.asp?msg=database updated" %>