📄 commentsave.asp
字号:
<!-- #include file="conn.asp" -->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/function.asp"--><%
if WebpinglunLOCKNum=1 then
if request.form("randm1")="" then
response.write "<script language=javascript>alert('请输入验证码!');history.back(-1);</script>"
response.end ()
end if
if request.form("randm1")<>request.form("randm2") then
session("CnendWeb_admin_login")=session("CnendWeb_admin_login")+1
response.write "<script language=javascript>alert('错误:验证码填写错误!');history.back(-1);</script>"
response.end ()
end if
end if
if Webpinglun=0 then
dim UserID,UserName,id,act,Content
UserID=CheckSql(request.cookies("CnEndWeb_User")("log_UserID"))
UserName=CheckSql(request.cookies("CnEndWeb_User")("log_UserName"))
If UserName="" or IsNull(UserID) Then
Response.Write ("<script>alert('CnEndWeb(终点)提醒: \n\n 可能您还没有登陆或者登陆超时! \n\n 如果您没有成为会员请先进行会员注册! \n\n 如果您已经是注册会员请重新登陆! ');history.back();</script>")
Response.End
End If
else
UserID=CheckSql(request.cookies("CnEndWeb_User")("log_UserID"))
UserName=CheckSql(request.cookies("CnEndWeb_User")("log_UserName"))
If UserName="" or IsNull(UserID) Then
userip1 = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
userip2 = Request.ServerVariables("REMOTE_ADDR")
If userip1 = "" Then
userip = userip2
Else
userip = userip1
End If
UserName="游客:"&userip
End If
end if
id=CheckSql(request("id"))
CheckSqlnum(id)
id=int(id)
Content=trim(Request.Form("Content"))
If Content="" Then
Response.Write ("<script>alert('CnEndWeb(终点)提醒: \n\n 请输入评论内容!~ ');history.back();</script>")
Response.end
elseIf strLength(Content)>CommentSize then
Response.Write ("<script>alert('CnEndWeb(终点)提醒: \n\n 您输入的评论内容大于"&CommentSize&"字符!~ ');history.back();</script>")
Response.end
End If
Select Case request.querystring("act")
Case "author"
Call author()
Case "user"
Call user()
Case "book"
Call book()
Case "article"
Call article()
end select
Sub user()
if session("CnendWeb_user_Comment")<>"" then
user_Comment=session("CnendWeb_user_Comment")
if CInt(DateDiff("s",user_Comment,now()))<=Commenttime then
response.write "<script>alert('CnEndWeb(终点)提醒:\n\n 系统限制 "&Commenttime&" 秒内不允许重复发表评论,请稍后再试 ');history.back(-1);</script>"
response.end
end if
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [Comment]"
rs.open sql,conn,1,3
rs.addnew
rs("UserName")=UserName
rs("Content")=unHtml(Content)
rs("type_ID")=id
rs("Commenttype")=3
rs("WriteTime")=Now()
if WebpinglunLOCK=1 then
rs("IsLock")=1
else
rs("IsLock")=0
end if
rs.update
rs.close
set rs=nothing
if Webpinglun=0 then
set rsauth=server.createobject("adodb.recordset")
sql="select UserPoint from [Userinfo] where ID="&UserID&""
rsauth.open sql,conn,1,3
if rsauth.eof and rsauth.bof then
Response.Write ("<br><font color='red'><B>在会员列表中找不到该会员的资料,无法增加积分。</B></font>")
Else
rsauth("UserPoint")=rsauth("UserPoint")+CommenttoPoint
rsauth.update
End If
rsauth.close
set rsauth=nothing
end if
session("CnendWeb_user_Comment")=now()
response.write "<script>alert('CnEndWeb(终点)提醒:\n\n操作成功! \n\n 感谢您参与评论^_^ ');history.back(-1);</script>"
response.end
end Sub
Sub author()
if session("CnendWeb_author_Comment")<>"" then
author_Comment=session("CnendWeb_author_Comment")
if CInt(DateDiff("s",author_Comment,now()))<=Commenttime then
response.write "<script>alert('CnEndWeb(终点)提醒:\n\n 系统限制 "&Commenttime&" 秒内不允许重复发表评论,请稍后再试 ');history.back(-1);</script>"
response.end
end if
end if
set rs=server.createobject("adodb.recordset")
sql="select * from Comment"
rs.open sql,conn,1,3
rs.addnew
rs("UserName")=UserName
rs("Content")=unHtml(Content)
rs("type_ID")=id
rs("Commenttype")=2
rs("WriteTime")=Now()
if WebpinglunLOCK=1 then
rs("IsLock")=1
else
rs("IsLock")=0
end if
rs.update
rs.close
set rs=nothing
if Webpinglun=0 then
set rsauth=server.createobject("adodb.recordset")
sql="select UserPoint from [Userinfo] where ID="&UserID&""
rsauth.open sql,conn,1,3
if rsauth.eof and rsauth.bof then
Response.Write ("<br><font color='red'><B>在会员列表中找不到该会员的资料,无法增加积分。</B></font>")
Else
rsauth("UserPoint")=rsauth("UserPoint")+CommenttoPoint
rsauth.update
End If
rsauth.close
set rsauth=nothing
end if
session("CnendWeb_author_Comment")=now()
response.write "<script>alert('CnEndWeb(终点)提醒:\n\n操作成功! \n\n 感谢您参与评论^_^ ');history.back(-1);</script>"
response.end
end Sub
Sub book()
if session("CnendWeb_book_Comment")<>"" then
book_Comment=session("CnendWeb_book_Comment")
if CInt(DateDiff("s",book_Comment,now()))<=Commenttime then
response.write "<script>alert('CnEndWeb(终点)提醒:\n\n 系统限制 "&Commenttime&" 秒内不允许重复发表评论,请稍后再试 ');history.back(-1);</script>"
response.end
end if
end if
set rs=server.createobject("adodb.recordset")
sql="select * from Comment"
rs.open sql,conn,1,3
rs.addnew
rs("UserName")=UserName
rs("Content")=unHtml(Content)
rs("type_ID")=id
rs("Commenttype")=1
rs("WriteTime")=Now()
if WebpinglunLOCK=1 then
rs("IsLock")=1
else
rs("IsLock")=0
end if
rs.update
rs.close
set rs=nothing
if makeJS=1 then
tempinglun(newplNum)
end if
if Webpinglun=0 then
set rsauth=server.createobject("adodb.recordset")
sql="select UserPoint from [Userinfo] where ID="&UserID&""
rsauth.open sql,conn,1,3
if rsauth.eof and rsauth.bof then
Response.Write ("<br><font color='red'><B>在会员列表中找不到该会员的资料,无法增加积分。</B></font>")
Else
rsauth("UserPoint")=rsauth("UserPoint")+CommenttoPoint
rsauth.update
End If
rsauth.close
set rsauth=nothing
end if
session("CnendWeb_book_Comment")=now()
response.write "<script>alert('CnEndWeb(终点)提醒:\n\n操作成功! \n\n 感谢您参与评论^_^ ');history.back(-1);</script>"
response.end
end Sub
Sub article()
if session("CnendWeb_article_Comment")<>"" then
article_Comment=session("CnendWeb_article_Comment")
if CInt(DateDiff("s",article_Comment,now()))<=Commenttime then
response.write "<script>alert('CnEndWeb(终点)提醒:\n\n 系统限制 "&Commenttime&" 秒内不允许重复发表评论,请稍后再试 ');history.back(-1);</script>"
response.end
end if
end if
set rs=server.createobject("adodb.recordset")
sql="select * from Comment"
rs.open sql,conn,1,3
rs.addnew
rs("UserName")=UserName
rs("Content")=unHtml(Content)
rs("type_ID")=id
rs("Commenttype")=4
rs("WriteTime")=Now()
if WebpinglunLOCK=1 then
rs("IsLock")=1
else
rs("IsLock")=0
end if
rs.update
rs.close
set rs=nothing
if Webpinglun=0 then
set rsauth=server.createobject("adodb.recordset")
sql="select UserPoint from [Userinfo] where ID="&UserID&""
rsauth.open sql,conn,1,3
if rsauth.eof and rsauth.bof then
Response.Write ("<br><font color='red'><B>在会员列表中找不到该会员的资料,无法增加积分。</B></font>")
Else
rsauth("UserPoint")=rsauth("UserPoint")+CommenttoPoint
rsauth.update
End If
rsauth.close
set rsauth=nothing
end if
session("CnendWeb_article_Comment")=now()
response.write "<script>alert('CnEndWeb(终点)提醒:\n\n操作成功! \n\n 感谢您参与评论^_^ ');history.back(-1);</script>"
response.end
end Sub
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -