?? newtopic.asp
字號:
<!-- #include file="setup.asp" -->
<%
if Request.Cookies("username")="" then
error("<li>您還還未<a href=login.asp>登陸</a>社區(qū)")
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限制一個人兩次發(fā)帖間隔必須大于30秒!<li>請等待 <font color=red><b><span id=yu>30</span><a href=javascript:countDown></a></b></font> 秒后系統(tǒng)自動刷新<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>內(nèi)容沒有填寫"
end if
if Len(topic)>30 then
message=message&"<li>文章主題不能大于 30 字節(jié)"
end if
if Len(content)>50000 then
message=message&"<li>文章內(nèi)容不能大于 50000 字節(jié)"
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>內(nèi)容中不能含有“ヴ ヂ ゼ ヅ”字符"
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> 不能發(fā)表文章<li>您可以到<A href=shop.asp>社區(qū)商店</A>購買體力藥丸<li>每有效停留時間<FONT color=red> 10 </FONT>分鐘:體力值:<FONT color=red>+10</FONT>"
end if
if rs("experience")<1 then
message=message&"<li>您的經(jīng)驗值 < <FONT color=red>1</FONT> 不能發(fā)表文章<li>您可以到<A href=shop.asp>社區(qū)商店</A>購買經(jīng)驗藥丸<li>每有效停留時間<FONT color=red> 10 </FONT>分鐘:經(jīng)驗值: <FONT color=red>+1</FONT>"
end if
if rs("membercode")=0 then
message=message&"<li>您被關(guān)進<a href=prison.asp>監(jiān)獄</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="新主題發(fā)表成功"
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>發(fā)表文章</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"> 發(fā)表文章</td>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -