📄 newtopic.asp
字号:
<!-- #include file="setup.asp" -->
<%
if Request.Cookies("username")="" then
error("<li>您还还未<a href=login.asp>登陆</a>社区")
end if
forumid=Request("forumid")
if isnumeric(""&forumid&"") = flase then
error("<li>非法操作")
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if Request.ServerVariables("request_method") = "POST" then
if instr(Request.ServerVariables("http_referer"),""&Request.ServerVariables("server_name")&"") = 0 then
error("<li>来源错误")
end if
username=Trim(Request("username"))
userpass=Trim(Request("userpass"))
forumid=Request("forumid")
icon=Request("icon")
topic=server.htmlencode(Trim(Request("topic")))
content=server.htmlencode(Trim(Request("content")))
if Request("htmlcode")<>"1" then
content=replace(content,vbCrlf,"<br>")
end if
if instr(username," ")>0 then:error("<li>非法操作"):end if
if DateDiff("s",session("make"),Now())<30 then
message=message&"<li>为防止有人用程序灌水,本BBS限制一个人两次发帖间隔必须大于30秒!<li>请等待 <font color=red><b><span id=yu>30</span><a href=javascript:countDown></a></b></font> 秒后系统自动刷新<meta http-equiv=refresh content=30;url=javascript:location.reload()><script>function countDown(secs){yu.innerText=secs;if(--secs>0)setTimeout('countDown('+secs+')',1000);}countDown(30);</script>"
end if
if username="" then
message=message&"<li>用户名没有填写"
end if
if userpass="" then
message=message&"<li>密码没有填写"
end if
if topic="" then
message=message&"<li>主题没有填写"
end if
if content="" then
message=message&"<li>内容没有填写"
end if
if Len(topic)>30 then
message=message&"<li>文章主题不能大于 30 字节"
end if
if Len(content)>50000 then
message=message&"<li>文章内容不能大于 50000 字节"
end if
if instr(topic,"ヴ") > 0 or instr(topic,"ヂ") > 0 or instr(topic,"ゼ") > 0 or instr(topic,"ヅ") > 0 then
message=message&"<li>主题中不能含有“ヴ ヂ ゼ ヅ”字符"
end if
if instr(content,"ヴ") > 0 or instr(content,"ヂ") > 0 or instr(content,"ゼ") or instr(content,"ヅ") > 0 then
message=message&"<li>内容中不能含有“ヴ ヂ ゼ ヅ”字符"
end if
filtrate=split(badwords,"|")
for i = 0 to ubound(filtrate)
topic=replace(topic,""&filtrate(i)&"","****")
content=replace(content,""&filtrate(i)&"","****")
next
''''''''''''''''''''
%>
<!-- #include file="inc/ybbcode.asp" -->
<%
smilies(content)
if Request("ybbcode")="" then
if ybbimg = "False" then
content=replace(content,"[IMG]","[URL]")
content=replace(content,"[/IMG]","[/URL]")
end if
if ybbflash = "False" then
content=replace(content,"[FLASH]","[URL]")
content=replace(content,"[/FLASH]","[/URL]")
end if
content = ybbcode(content)
end if
''''''''''''''''''''
if Request("htmlcode")="1" then
content="<TEXTAREA cols=75 rows=6>"&content&"</TEXTAREA><br><INPUT onclick=runEx() type=button value=运行此代码>"
end if
sql="select * from user where username='"&username&"'"
rs.Open sql,Conn,1,3
if rs.eof then
message=message&"<li>此用户名还未<a href=register.asp?username="&username&">注册</a>"
error(""&message&"")
end if
if userpass<>rs("userpass") then
message=message&"<li>您的密码错误"
end if
if rs("userlife")<5 then
message=message&"<li>您的体力值 < <FONT color=red>5</FONT> 不能发表文章<li>您可以到<A href=shop.asp>社区商店</A>购买体力药丸<li>每有效停留时间<FONT color=red> 10 </FONT>分钟:体力值:<FONT color=red>+10</FONT>"
end if
if rs("experience")<1 then
message=message&"<li>您的经验值 < <FONT color=red>1</FONT> 不能发表文章<li>您可以到<A href=shop.asp>社区商店</A>购买经验药丸<li>每有效停留时间<FONT color=red> 10 </FONT>分钟:经验值: <FONT color=red>+1</FONT>"
end if
if rs("membercode")=0 then
message=message&"<li>您被关进<a href=prison.asp>监狱</a>"
end if
if message<>"" then
error(""&message&"")
end if
if icon = "" then
randomize
icon=Int((24*rnd)+1)
end if
if rs("membercode")<2 then
experience=rs("experience")
%>
<!-- #include file="inc/level.asp" -->
<%
rs("userlife")=rs("userlife")-5
rs("levelname")=levelname
rs("levelimage")=levelimage
end if
rs("landtime")=now
rs("posttopic")=rs("posttopic")+1
rs("money")=rs("money")+5
rs("experience")=rs("experience")+5
rs.update
rs.close
rs.Open "forum",conn,1,3
rs.addnew
rs("username")=username
rs("forumid")=forumid
rs("topic")=topic
rs("content")=content
rs("postip")=remoteaddr
rs("icon")=icon
'''''''''''''''''''''''''''''''''''
'投票处理程序
if Request("vote")<>"" then
vote=server.htmlencode(Trim(Request("vote")))
if instr(vote,"|") > 0 then
message=message&"<li>投票选项中不能含有“|”字符"
error(""&message&"")
end if
polltopic=split(vote,chr(13)&chr(10))
j=0
for i = 0 to ubound(polltopic)
if not (polltopic(i)="" or polltopic(i)=" ") then
allpolltopic=""&allpolltopic&""&polltopic(i)&"|"
j=j+1
end if
next
for y = 1 to j
votenum=""&votenum&"0|"
next
rs("polltopic")=allpolltopic
rs("pollresult")=votenum
rs("multiplicity")=Request("multiplicity")
end if
'''''''''''''''''''''''''''''''''''
rs.update
id=rs("id")
rs.close
conn.execute("update [bbsconfig] set lastname='"&username&"',lasttime=now,toltopic=toltopic+1,tolrestore=tolrestore+1 where id="&forumid&"")
session("make")=now
succtitle="新主题发表成功"
message="<li><a href=showtopic.asp?id="&id&"&forumid="&forumid&">返回主题</a><li><a href=forumdisplay.asp?forumid="&forumid&">返回论坛</a><li><a href=index.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=forumdisplay.asp?forumid="&forumid&">")
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sql="select * from bbsconfig where id="&forumid&""
rs.Open sql,Conn
top
%>
<title>发表文章</title>
<CENTER>
<table width="750" align="center" border="0">
<tr>
<td vAlign="top" width="30%"><img src="images/logo.gif" border="0"></td>
<td vAlign="center" align="top"> <img src="images/closedfold.gif" border="0"> <a href="index.asp"><%=clubname%></a><br>
<img src="images/bar.gif" border="0"><img src="images/closedfold.gif" border="0"> <a href="forumdisplay.asp?forumid=<%=forumid%>"><%=rs("bbsname")%></a><br>
<img src="images/bar.gif" border="0"><img src="images/openfold.gif" border="0"> 发表文章</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -