%
Function xieTag(who)
Dim s
s=who
rs.Open "mgtag",Conn
do while not rs.eof
s=replace(s,rs("tagname"),""+rs("tagname")+"")
rs.movenext
loop
rs.close
xieTag=s
End Function
top
if Request.Cookies("username")=empty then error("
您还未登录社区")
DetectPost
forumid=int(Request("forumid"))
color=HTMLEncode(Request.Form("color"))
topic=HTMLEncode(Request.Form("topic"))
content=ContentEncode(Request.Form("content"))
content=xieTag(content)
if badwords<>empty then
filtrate=split(badwords,"|")
for i = 0 to ubound(filtrate)
topic=ReplaceText(topic,""&filtrate(i)&"",string(len(filtrate(i)),"*"))
next
end if
sql="select * from bbsconfig where id="&forumid&""
Set Rs=Conn.Execute(sql)
bbsname=rs("bbsname")
logo=rs("logo")
moderated=rs("moderated")
followid=rs("followid")
pass=rs("pass")
password=rs("password")
userlist=rs("userlist")
rs.close
if membercode>1 or instr("|"&moderated&"|","|"&Request.Cookies("username")&"|")>0 then UserPopedomPass=1
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if Request.ServerVariables("request_method") = "POST" and Request("preview")="" then
If not conn.Execute("Select username from prison where username='"&Request.Cookies("username")&"'" ).eof Then error("
您被关进监狱")
username=Request.Cookies("username")
icon=Request("icon")
if Len(topic)<2 then message=message&"
文章主题不能小于 2 字符"
if Len(content)<2 then message=message&"
文章内容不能小于 2 字符"
if Application(CacheName&"LastPostName")=username then
if DateDiff("s",Application(CacheName&"LastPostTime"),Now()) < int(PostTime) then message=message&"
为防止有人用程序灌水,论坛限制一个人两次发帖间隔必须大于"&PostTime&"秒!"
end if
if message<>"" then error(""&message&"")
sql="select * from user where username='"&HTMLEncode(username)&"'"
rs.Open sql,Conn,1,3
if rs("userlife")<3 then message=message&"
您的体力值 < 3 不能发表文章
每有效停留时间 10 分钟:体力值:+10"
StopPostTime=int(DateDiff("s",rs("regtime"),Now())/60)
if StopPostTime < int(Reg10) then message=message&"
新注册用户必须 "&Reg10&" 分钟后才能发帖,您必须再等待 "&Reg10-StopPostTime&" 分钟!"
if message<>"" then error(""&message&"")
if UserPopedomPass<>1 then rs("userlife")=rs("userlife")-3
rs("posttopic")=rs("posttopic")+1
rs("money")=rs("money")+3
rs("experience")=rs("experience")+3
rs("landtime")=now()
rs.update
rs.close
if UserPopedomPass=1 and color<>"" then topic=""&topic&""
rs.Open "select * from forum order by id desc limit 0,1",conn,1,3
rs.addnew
rs("username")=username
rs("lastname")=username
rs("forumid")=forumid
rs("topic")=topic
rs("content")=content
rs("postip")=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
rs("icon")=icon
rs("deltopic")=ActivationForum
rs("ReList")=ReForumName
rs("posttime")=now()
rs("lasttime")=now()
'####翔宇特殊贴V2.0 此部分孤风修改#################
if Request("NeedValue")<>"" then
rs("TopicType")=int(Request("TopicType"))
rs("NeedValue")=Request("NeedValue")
else
rs("TopicType")=0
rs("NeedValue")="0"
end if
'####翔宇特殊贴V2.0 此部分孤风修改##################
'''''''''''''''''''''''''''''''''''
'投票处理程序
if Request("vote")<>"" then
vote=Request("vote")
if instr(vote,"|") > 0 then error("
投票选项中不能含有“|”字符")
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
if j<2 then error("
至少需要2个选项")
for y = 1 to j
votenum=""&votenum&"0|"
next
rs("polltopic")=HTMLEncode(allpolltopic)
rs("pollresult")=votenum
rs("multiplicity")=Request("multiplicity")
end if
'''''''''''''''''''''''''''''''''''
rs.update
id=rs("id")+1
rs.close
conn.execute("update bbsconfig set lasttopic='"&left(HTMLEncode(Request.Form("topic")),15)&"',lastname='"&username&"',lasttime='"&now()&"',today=today+1,toltopic=toltopic+1,tolrestore=tolrestore+1 where id="&forumid&"")
conn.execute("update clubconfig set today=today+1")
Application.Lock
Application(CacheName&"CountForum") = Application(CacheName&"CountForum")+1
Application(CacheName&"LastPostName")=username
Application(CacheName&"LastPostTime")=now()
Application.UnLock
if ActivationForum=1 then
ActivationForum="由于论坛设有审核制度,您发表的帖子需要等待管理员激活才能显示于论坛。"
else
ActivationForum="返回主题"
end if
message="