%
SiteSettings=Conn.Execute("[BBSXP_SiteSettings]")
CookieUserName=HTMLEncode(unescape(Request.Cookies("UserName")))
if ""&SiteSettings("nowdate")&""<>""&date()&"" then
Conn.execute("update [BBSXP_SiteSettings] set Nowdate='"&date()&"'")
Conn.execute("update [BBSXP_Statistics_Site] set TodayPost=0")
Conn.execute("update [BBSXP_Forums] set ForumToday=0")
end if
dim toptrue,ForumsList,ForumTreeList,TotalPage,PageCount,RankName,RankIconUrl
ii=0
startime=timer()
Set rs = Server.CreateObject("ADODB.Recordset")
Server.ScriptTimeout=SiteSettings("Timeout")'设置脚本超时时间 单位:秒
function HTMLEncode(fString)
fString=Replace(fString,";",";")
fString=Replace(fString,"<","<")
fString=Replace(fString,">",">")
fString=Replace(fString,"\","\")
fString=Replace(fString,"--","--")
fString=Replace(fString,CHR(9)," ")
fString=Replace(fString,CHR(10),"
")
fString=Replace(fString,CHR(13),"")
fString=Replace(fString,CHR(22),"")
fString=Replace(fString,CHR(32)," ")
fString=Replace(fString,CHR(34),""")'双引号
fString=Replace(fString,CHR(39),"'")'单引号
fString=ReplaceText(fString,"([0-9]*);","$1;") '解决韩文字符问题
if IsSqlDataBase=0 then '过滤片假名(日文字符)[\u30A0-\u30FF] by yuzi首创
fString=escape(fString)
fString=ReplaceText(fString,"%u30([A-F][0-F])","0$1;")
fString=unescape(fString)
end if
HTMLEncode=fString
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function ContentEncode(fString)
fString=Replace(fString,vbCrlf, "")
fString=Replace(fString,"\","\")
fString=Replace(fString,"'","'")
fString=Replace(fString,""" then fString=ReplaceText(fString,"<(\/|)("&SiteSettings("BannedHtmlLabel")&")", "<$1$2")
if SiteSettings("BannedHtmlEvent")<>"" then fString=ReplaceText(fString,"<(.[^>]*)("&SiteSettings("BannedHtmlEvent")&")", "<$1$2")
if SiteSettings("BannedText")<>"" then
filtrate=split(SiteSettings("BannedText"),"|")
for i = 0 to ubound(filtrate)
fString=ReplaceText(fString,""&filtrate(i)&"",string(len(filtrate(i)),"*"))
next
end if
contentEncode=fString
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function YbbEncode(str)
str=ReplaceText(str,"\[(\/|)(b|i|u|strike|center|marquee)\]","<$1$2>")
str=ReplaceText(str,"\[COLOR=([^[]*)\]","")
str=ReplaceText(str,"\[FONT=([^[]*)\]","")
str=ReplaceText(str,"\[SIZE=([0-9]*)\]","")
str=ReplaceText(str,"\[\/(SIZE|FONT|COLOR)\]","")
str=ReplaceText(str,"\[QUOTE\]","引用:
")
str=ReplaceText(str,"\[\/QUOTE\]","
")
str=ReplaceText(str,"\[URL\]([^[]*)","$1")
str=ReplaceText(str,"\[URL=([^[]*)\]","")
str=ReplaceText(str,"\[\/URL\]","")
str=ReplaceText(str,"\[EMAIL\](\S+\@[^[]*)(\[\/EMAIL\])","$1")
str=ReplaceText(str,"\[IMG\]([^[]*)(\[\/IMG\])","")
YbbEncode=str
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
On Error GoTo 0
End Function
Function CheckSize(ByteSize)
if ByteSize=>1024000 then
ByteSize=formatnumber(ByteSize/1024000)&" MB"
elseif ByteSize=>1024 then
ByteSize=formatnumber(ByteSize/1024)&" KB"
else
ByteSize=ByteSize&" 字节"
end if
CheckSize=ByteSize
End Function
'帐号验证
UserName=HTMLEncode(Request("UserName"))
Userpass=md5(Trim(Request("Userpass")))
if UserName=empty then
response.Write("[err]用户名没有输入[/err]")
CloseDatabase
end if
sql="select * from [BBSXP_Users] where UserName='"&UserName&"'"
Set Rs1=Conn.Execute(SQL)
if rs1.eof then
response.Write("[err]此用户名还未注册[/err]")
CloseDatabase
end if
if rs1("membercode")=0 then
response.Write("[err]您的帐号尚未激活[/err]")
CloseDatabase
end if
if Len(rs1("Userpass"))<16 then
if Request("Userpass")<>rs1("Userpass") then
response.Write("[err]您输入的密码错误[/err]")
CloseDatabase
end if
elseif Len(rs1("Userpass"))=16 then
if md5(Request("Userpass"))<>rs1("Userpass") then
response.Write("[err]您输入的密码错误[/err]")
CloseDatabase
end if
else
if Userpass<>rs1("Userpass") then
response.Write("[err]您输入的密码错误[/err]")
CloseDatabase
end if
end if
if trim(Request("ForumID"))="" then
response.Write("[err]没有输入版块号[/err]")
CloseDatabase
end if
ForumID=int(Request("ForumID"))
VoteExpiry=int(Request("VoteExpiry"))
sql="select * from [BBSXP_Forums] where id="&ForumID&""
Set Rs=Conn.Execute(sql)
ForumName=Rs("ForumName")
ForumLogo=Rs("ForumLogo")
moderated=Rs("moderated")
followid=Rs("followid")
ForumPass=Rs("ForumPass")
ForumPassword=Rs("ForumPassword")
ForumUserList=Rs("ForumUserList")
TolSpecialTopic=Rs("TolSpecialTopic")
ForumPass=Rs("ForumPass")
Rs.close
if membercode>1 or instr("|"&moderated&"|","|"&CookieUserName&"|")>0 then UserPopedomPass=1
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'if Request.ServerVariables("request_method") = "POST" then
'if sitesettings("EnableAntiSpamTextGenerateForPost")=1 then
'if Request.Form("VerifyCode")<>Session("VerifyCode") then Message=Message&"验证码错误"
'end if
color=HTMLEncode(Request("color"))
icon=Request.Form("icon")
Subject=HTMLEncode(Request("Subject"))
SpecialTopic=HTMLEncode(Request("SpecialTopic"))
Content=ContentEncode(Request("Content"))
if Request("DisableYBBCode")<>1 then Content=YbbEncode(Content)
if Len(Subject)<2 then Message=Message&"文章主题不能小于 2 字符"
if Len(content)<2 then Message=Message&"文章内容不能小于 2 字符"
if SiteSettings("BannedText")<>empty then
filtrate=split(SiteSettings("BannedText"),"|")
for i = 0 to ubound(filtrate)
Subject=ReplaceText(Subject,""&filtrate(i)&"",string(len(filtrate(i)),"*"))
next
end if
'''''''''''''''''''''''''''''''
'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 jSiteSettings("MaxVoteOptions") then error("投票选项不能少于 "&SiteSettings("MinVoteOptions")&" 个投票选项超过 "&SiteSettings("MaxVoteOptions")&" 个")
'for y = 1 to j
'Votenum=""&Votenum&"0|"
'next
'end if
'''''''''''''''''''''''''''''''
if Message<>"" then
response.Write("[err]"&Message&"[/err]")
CloseDatabase
end if
sql="select * from [BBSXP_Users] where UserName='"&UserName&"'"
Rs.Open sql,Conn,1,3
'if SiteSettings("DuplicatePostIntervalInMinutes") > 0 then
'StopPostTime=int(DateDiff("s",Rs("UserLandTime"),Now()))
'if StopPostTime < int(SiteSettings("DuplicatePostIntervalInMinutes")) then Message=Message&"论坛限制一个人两次发帖间隔必须大于 "&SiteSettings("DuplicatePostIntervalInMinutes")&" 秒!您必须再等待 "&SiteSettings("DuplicatePostIntervalInMinutes")-StopPostTime&" 秒!"
'end if
'if SiteSettings("RegUserTimePost") > 0 then
'StopPostTime=int(DateDiff("s",Rs("UserRegTime"),Now()))
'if StopPostTime < int(SiteSettings("RegUserTimePost")) then Message=Message&"新注册用户必须等待 "&SiteSettings("RegUserTimePost")&" 秒后才能发帖!您必须再等待 "&SiteSettings("RegUserTimePost")-StopPostTime&" 秒!"
'end if
if Message<>"" then
response.Write("[err]"&Message&"[/err]")
CloseDatabase
end if
Rs("PostTopic")=Rs("PostTopic")+1
Rs("UserMoney")=Rs("UserMoney")+SiteSettings("IntegralAddThread")
Rs("experience")=Rs("experience")+SiteSettings("IntegralAddThread")
Rs("UserLandTime")=now()
Rs("UserLastIP")=Request.ServerVariables("REMOTE_ADDR")
Rs.update
Rs.close
if UserPopedomPass=1 and color<>"" then Subject=""&Subject&""
Rs.Open "select * from [BBSXP_Threads]",Conn,1,3
Rs.addNew
Rs("UserName")=UserName
Rs("PostTime")=now()
Rs("lastname")=UserName
Rs("lasttime")=now()
Rs("Topic")=Subject
Rs("ForumID")=ForumID
Rs("PostsTableName")=SiteSettings("DefaultPostsName")
if Request("SpecialTopic")<>"" then Rs("SpecialTopic")=SpecialTopic
if Request("icon")<>"" then Rs("icon")=icon
if Request("Vote")<>"" then Rs("isVote")=1
if Request("IsLocked")=1 then Rs("IsLocked")=1
if ForumPass=5 then Rs("IsDel")=1
Rs.update
ID=Rs("ID")
Rs.close
'if Request.Form("Vote")<>"" then
'Conn.Execute("insert into [BBSXP_Vote] (ThreadID,Type,Items,Result,Expiry) values ('"&ID&"','"&int(Request.Form("multiplicity"))&"','"&HTMLEncode(allpollTopic)&"','"&Votenum&"','"&now()+VoteExpiry&"')")
'end if
'if Request.Form("UpFileID")<>"" then
'UpFileID=split(Request.form("UpFileID"),",")
'for i = 0 to ubound(UpFileID)-1
'Conn.execute("update [BBSXP_PostAttachments] set ThreadID="&ID&",Description='"&Subject&"' where id="&int(UpFileID(i))&" and ThreadID=0")
'next
'end if
Conn.Execute("insert into [BBSXP_Posts"&SiteSettings("DefaultPostsName")&"] (ThreadID,IsTopic,UserName,Subject,content,Postip) values ('"&ID&"','1','"&UserName&"','"&Subject&"','"&content&"','"&Request.ServerVariables("REMOTE_ADDR")&"')")
Conn.execute("update [BBSXP_Forums] set lastTopic='"&Left(HTMLEncode(Request("Subject")),15)&"',lastname='"&UserName&"',lasttime="&SqlNowString&",ForumToday=ForumToday+1,ForumThreads=ForumThreads+1,ForumPosts=ForumPosts+1 where id="&ForumID&"")
Conn.execute("update [BBSXP_Statistics_Site] set TodayPost=TodayPost+1,TotalPost=TotalPost+1,TotalThread=TotalThread+1")
Session("VerifyCode")=""
'if ForumPass=5 then
'EnableCensorship="由于论坛设有审查制度,您发表的帖子需要等待激活才能显示。"
'else
'EnableCensorship="返回主题"
'end if
'Message="新主题发表成功"&EnableCensorship&"返回论坛返回论坛首页"
'succeed(""&Message&"")
'end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
response.Write("1")
CloseDatabase
%>