博客开通以来,一直饱受垃圾评论和回复的骚扰,简而言之就是有各式各样回复者昵称中含广告的回复。

但是我又不想把回复删除,因为毕竟也算是一个回复,而且会破坏之前的ID排序,所以我一般都是通过FTP下载数据库之后进行手动修改。

有着太多的不方便,也嫌麻烦,就试着修改了这个功能。可以后台直接修改回复者的昵称和网址,详细效果见图:

------------华丽的分割线-------------

附上修改教程:

1、打开control\c_comment.asp文件

找到代码:

            SQL = "Select book_ID,book_Content,book_Messager,book_PostTime,book_IP,book_reply FROM blog_book orDER BY book_PostTime desc"

把以上代码修改为:

            SQL = "Select book_ID,book_Content,book_Messager,book_PostTime,book_IP,book_reply,book_WebSite FROM blog_book orDER BY book_PostTime desc"

找到代码:

            SQL = "Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_PostIP,blog_ID,T.log_Title, C.comm_IsAudit from blog_Comment C,blog_Content T Where C.blog_ID=T.log_ID orDER BY C.comm_PostTime desc"

把以上代码修改为:

            SQL = "Select comm_ID,comm_Content,comm_Author,comm_PostTime,comm_PostIP,blog_ID,T.log_Title, C.comm_IsAudit,comm_reply,comm_WebSite from blog_Comment C,blog_Content T Where C.blog_ID=T.log_ID orDER BY C.comm_PostTime desc"

找到代码:

<img src="images/reply.gif" alt=""><b><%=HtmlEncode(commArr(2,Pcount))%></b>

把以上代码修改为:

<img src="images/reply.gif" alt=""><input name="username_<%=commArr(0,Pcount)%>" size="6" value="<%=commArr(2,Pcount)%>" style="border-left:0px;border-top:0px;border-right:0px;border-bottom:1px"> <input name="website_<%=commArr(0,Pcount)%>" size="18" value="<%=commArr(6,Pcount)%>" style="border-left:0px;border-top:0px;border-right:0px;border-bottom:1px">

找到代码:

<img src="images/icon_quote.gif" alt=""><b><%=HtmlEncode(commArr(2,Pcount))%></b>

把以上代码修改为:

<img src="images/icon_quote.gif" alt=""><input name="username_<%=commArr(0,Pcount)%>" size="6" value="<%=commArr(2,Pcount)%>" style="border-left:0px;border-top:0px;border-right:0px;border-bottom:1px"> <input name="website_<%=commArr(0,Pcount)%>" size="18" value="<%=commArr(9,Pcount)%>" style="border-left:0px;border-top:0px;border-right:0px;border-bottom:1px">

2、打开control\Action.asp文件

找到代码:

                If Int(Request.Form("edited_"&doCommID(i))) = 1 Then
                    conn.Execute("Update blog_book SET book_Content='"&checkStr(Request.Form("message_"&doCommID(i)))&"',book_replyAuthor='"&memName&"',book_replyTime=#"&DateToStr(Now(), "Y-m-d H:I:S")&"#,book_reply='"&checkStr(Request.Form("reply_"&doCommID(i)))&"' Where book_ID="&doCommID(i))
                Else
                    conn.Execute("Update blog_book SET book_Content='"&checkStr(Request.Form("message_"&doCommID(i)))&"',book_reply='"&checkStr(Request.Form("reply_"&doCommID(i)))&"' Where book_ID="&doCommID(i))
                End If

把以上代码修改为:

                If Int(Request.Form("edited_"&doCommID(i))) = 1 Then
                    conn.Execute("Update blog_book SET book_Messager='"&checkStr(Request.Form("username_"&doCommID(i)))&"',book_WebSite='"&checkStr(Request.Form("website_"&doCommID(i)))&"',book_Content='"&checkStr(Request.Form("message_"&doCommID(i)))&"',book_replyAuthor='"&memName&"',book_replyTime=#"&DateToStr(Now(), "Y-m-d H:I:S")&"#,book_reply='"&checkStr(Request.Form("reply_"&doCommID(i)))&"' Where book_ID="&doCommID(i))
                Else
                    conn.Execute("Update blog_book SET book_Messager='"&checkStr(Request.Form("username_"&doCommID(i)))&"',book_WebSite='"&checkStr(Request.Form("website_"&doCommID(i)))&"',book_Content='"&checkStr(Request.Form("message_"&doCommID(i)))&"',book_reply='"&checkStr(Request.Form("reply_"&doCommID(i)))&"' Where book_ID="&doCommID(i))
                End If

找到代码:

                conn.Execute("Update blog_Comment SET comm_Content='"&checkStr(Request.Form("message_"&doCommID(i)))&"',comm_IsAudit=" & doAuditTrue & " Where comm_ID="&doCommID(i))

把以上代码修改为:

                conn.Execute("Update blog_Comment SET comm_Author='"&checkStr(Request.Form("username_"&doCommID(i)))&"',comm_WebSite='"&checkStr(Request.Form("website_"&doCommID(i)))&"',comm_Content='"&checkStr(Request.Form("message_"&doCommID(i)))&"',comm_IsAudit=" & doAuditTrue & " Where comm_ID="&doCommID(i))