📄 newreply.asp
字号:
<!--#include file="MarcosCB.asp"-->
<%
getConn()
isIn()
dim str,pageCode,pageTitle,pageOther,PageFormX
dim body,content,boardId,boardName,theAct,replyId,topicId,lastPostInfo
str=getMainCode(mySkinId)
theAct=getPost("theAct")
boardId=getPost("boardId")
topicId=getPost("topicId")
replyId=getPost("replyId")
boardName=getPost("boardName")
if not isNumeric(boardId) or topicId="" or not isNumeric(topicId) then
echo "错误的数据参数!"
closeConn()
response.End()
end if
nowWhere "发表新回复","javascript:;"
if theAct="reply" then
dim replyTitle,replyContent,replyMood
replyMood=getPost("mood")
replyTitle=rtrim(getPost("title"))
replyContent=rtrim(getPost("content"))
if replyContent="" then
echo "<script>alert('请填写帖子内容!');history.back();</script>"
closeConn()
response.end
end if
sql="select topicId,topicTitle from Marcos_Topic where isLocked=false and isRecycled=false and topicId=" & topicId
set rs_sys=conn.execute(sql)
if rs_sys.eof then
echo "错误的帖子参数!(可能帖子已被删除或者被锁定)"
closeConn()
response.end
end if
if request.cookies("topicContentPosted")=rtrim(replyContent) then
echo "<script>alert('发一样内容的帖子你不会累吗?');history.back();</script>"
closeConn()
response.end
end if
sql="Marcos_Reply"
rs.open sql,conn,1,3
rs.addNew
rs("topicId")=topicId
rs("replyTitle")=replyTitle
rs("replyContent")=replyContent
rs("replyMood")=replyMood
rs("userName")=getValue("userName")
rs("replyTime")=now()
replyContent=replyTitle & vbnewline & replyContent
if len(replyContent)>15 then
replyContent=left(replyContent,15) & "..."
end if
replyContent="回复者:@@" & getValue("userName") & "$$$回复时间:@@" & now() & "$$$回复内容:@@" & replyContent
rs("lastPostInfo")=replyContent
rs.update
rs.close
delPageIndex()
lastPostInfo="主题:<a href=""topicShow.asp?boardName="&boardName&"&boardId="&boardId&"&topicId="&rs_sys(0)&""">"&left(rs_sys(1),5)&"..</a><br>回复:<a href=""userInfo.asp?userName="&getValue("userName")&""" target=_blank>"&getValue("userName")&"</a><br>时间:"&mid(now(),6,len(mid(now(),6))-3)
conn.execute("update Marcos_Board set replyCount=replyCount+1,lastPostInfo='"&lastPostInfo&"' where boardId=" & boardId)
conn.execute("update Marcos_User set userWealth=userWealth+"&newReplyFen&",userArticle=userArticle+1 where userId="&getValue("userId"))
conn.execute("update Marcos_Topic set lastPostInfo='" & replyContent & "' ,lastReplyTime='"&now()&"',replyCount=replyCount+1 where topicId=" & topicId)
response.cookies("topicContentPosted")=rtrim(getPost("content"))
locate "topicShow.asp?boardId=" & boardId & "&boardName=" & boardName & "&topicId=" & topicId
end if
pageTitle="<a href=""topicList.asp?boardId=" & boardId & "&boardName=" & boardName & """>" & boardName & "</a> » <a href=javascript:location.reload();>发表回复</a>"
pageOther="<script>document.title+=' - 发表回复';</script>"
showHead str,pageTitle,pageOther
showBody()
showFoot(str)
sub showBody()
pageCode=getPageCode(mySkinId,"PageFormX")
PageFormX=split(pageCode,"$$$")
if theAct="quota" then
if isNumeric(replyId) then
sql="select replyContent,userName,replyTime from Marcos_Reply where replyId="&replyId
set rs_sys=conn.execute(sql)
else
sql="select topicContent,userName,addTime from Marcos_Topic where topicId="&topicId
set rs_sys=conn.execute(sql)
end if
queryTimes=queryTimes+1
content=rs_sys(0)
if len(content)>200 then
content=left(content,200) & vbNewLine & "..."
end if
content="[quota][b]以下是引用 "&rs_sys(1)&" 在"&rs_sys(2)&"发表的内容:[/b]"&vbNewLine&content&"[/quota]"&vbNewLine
end if
body=PageFormX(0)
body=body & PageFormX(2)
body=replace(body,"{$title}","")
body=replace(body,"{$content}",content)
body=replace(body,"{$moodSelected}","")
body=replace(body,"{$formTitle}","发表回复")
body=replace(body,"{$theAct}","reply")
body=replace(body,"{$boardId}",boardId)
body=replace(body,"{$topicId}",topicId)
body=replace(body,"{$boardName}",boardName)
' body=replace(body,"{$}","")
echo body
end sub
closeConn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -