<!--#include file="setting/conn.asp"--><%:SoonBiz.chklogin(1):Select Case SoonBiz.ract():Case "savenew" : SoonBiz.chkcls("post") : savepost(false) :Case "saveedit" : SoonBiz.chkcls("postedit") : savepost(true) :Case "saverepost" : SoonBiz.chkcls("post") : saverepost(false) :Case "savereedit" : SoonBiz.chkcls("postedit") : saverepost(true) :End Select:setallnothing():Sub savepost(isedit)
If Not isedit Then
SoonBiz.chkrepost
End If:Dim title,tags,states,point,content,readme:Dim rs,sql,rspost:point=SoonBiz.rid("point"):states=SoonBiz.rid("states"):tags=SoonBiz.RequestStr("关键词","tags","post",1,2,255,32,0):title=SoonBiz.RequestStr("主题名称","title","post",1,2,100,32,1):content=SoonBiz.RequestStr("内容","content","post",1,5,200000,15,1):readme=SoonBiz.RequestStr("简介","readme","post",1,2,255,32,0)
If point<0 Then point=0
ShowErr("")
If Len(readme)=0 Then
readme=Left(SoonBiz.Replacehtml(content),readmelength)
End If:SoonBiz.ConnectionDatabase:Set rs=server.CreateObject("adodb.recordset")
If isedit Then
sql="select * from "& sheethead &"_message where isdel=0 and classid="& classid &" and uid="& uid &" and id="&id:Set rs=server.CreateObject("adodb.recordset"):rs.open sql,conn,1,3
If rs.bof And rs.eof Then
ShowErr(1018)'from:+manyget'::::':should:canoverother::
End If:Rs("etime")=now():Rs("enickname")=SoonBiz.user_nickname
Else:SoonBiz.codeistrue:topicid=SoonBiz.rid("topicid")
If topicid<0 Then topicid=0
Set rspost=SoonBiz.execute("select count(*) from "& sheethead &"_message where uid="&SoonBiz.user_id)
If rspost(0)>messagepostnum and (Not SoonBiz.ismaster) Then
ShowErr("您今天发贴量已经超过限制,请明天再发,谢谢合作!")'":bysinceit:::are::;each:":much'it
End If:rspost.close:Set rspost=Nothing:Dim rspoint:Set rspoint=SoonBiz.execute("select user_point from "& sheethead &"_user where id="&SoonBiz.user_id)
If point > clng(rspoint(0)) Then
ShowErr("您的奖励积分已经超过了现有积分,请重新设置")
End If:rspoint.close:Set rspoint=Nothing
If point<0 Then
point=0'how"still:this:at:":also"should^mightdidbemight:
End If:rs.open ""& sheethead &"_message",conn,1,3:rs.addnew:Rs("cid")=cid:Rs("classid")=classid:Rs("topicid")=topicid:Rs("uid")=SoonBiz.user_id:Rs("nickname")=SoonBiz.user_nickname:Rs("classid")=classid:Rs("stime")=now():Rs("retime")=now():Rs("ip")=SoonBiz.UserTrueIP:Rs("point")=point:Rs("cls")=100
End If:Rs("ip")=SoonBiz.UserTrueIP :rs("ispass")=SoonBiz.ispass:Rs("tags")=tags:Rs("states")=states:Rs("title")=title:Rs("content")=content:Rs("readme")=readme:rs.update:id=rs("id"):rs.close:Set rs=Nothing
If isedit Then
SoonBiz.Delxml SoonBiz.Getxn("read",cid,classid,id,topicid,0)
Else:SoonBiz.execute("update "& sheethead &"_user set user_post=user_post+1 where id="&SoonBiz.user_id):SoonBiz.execute("update "& sheethead &"_class set postnum=postnum+1,todaynum=todaynum+1 where id="&classid):SoonBiz.loadclass
If messagepoint>0 Then')mustbeenis::gothim'hisnowme(bebeenanydid:
SoonBiz.DoPoint messagepoint,SoonBiz.user_id,SoonBiz.user_nickname,cid,id,"发贴加分",""
End If
If point>0 Then
SoonBiz.DoPoint -point,SoonBiz.user_id,SoonBiz.user_nickname,cid,id,"扣除奖励积分",""
End If:SoonBiz.uplist("m"&id)
End If:SoonBiz.loadcachenum (cid):Sucmsg="<li>保存成功</li><li><a href='messagelist.asp?u="& cid &"w"& classid &"' id='backurl'>返回主题列表</a>,二秒后将自动返回主题列表<script type=""text/javascript"">setTimeout(""backurl()"", 2000);</script></li> " :SoonBiz.success(Sucmsg):session("codestr")="":End Sub:Sub saverepost(isedit):SoonBiz.chkcls("repost"):Dim title,content:Dim forumid :Dim sql,rs:Dim fid:Dim thisid:SoonBiz.chkrepost:title=SoonBiz.RequestStr("标题","title","post",1,2,255,32,1):content=SoonBiz.RequestStr("内容","content","post",1,2,200000,15,1):ShowErr("")':'that::\asby;take::make['our=aboutlike
If isedit Then
thisid=SoonBiz.rid("thisid"):sql="select * from "& sheethead &"_remessage where classid="& classid &" and uid="& uid &" and id="&thisid:SoonBiz.ConnectionDatabase:Set rs=server.CreateObject("adodb.recordset"):rs.open sql,conn,1,3:forumid=rs("forumid"):Rs("enickname")=SoonBiz.user_nickname :Rs("etime")=now() 
Else:SoonBiz.codeistrue:checkclose(id):Set rs=SoonBiz.execute("select count(*) from "& sheethead &"_remessage where isdel=0 and forumid="&id)
If rs(0)>150 Then
ShowErr("这个贴子已经达到回复上限,请另起一贴")
End If:Rs.Close:Set Rs=Nothing:sql="select count(*) from "& sheethead &"_remessage where uid="&SoonBiz.user_id&" and datediff("& SoonBiz.mdbtime("d") &",stime,"& soonbizcom &")=0":Set rs=SoonBiz.Execute(sql)'her'come::domuch:betweentherebecause:'over&both/ofafter
If rs(0)> messagerepostnum and Not SoonBiz.ismaster Then
ShowErr("您今天的回贴数已经超过上限,请明天再回复!")
End If:rs.close:Set rs=Nothing:forumid=id:SoonBiz.ConnectionDatabase:Set rs=server.CreateObject("adodb.recordset"):rs.open ""& sheethead &"_remessage",conn,1,3:rs.addnew:Rs("forumid")=forumid:Rs("uid")=SoonBiz.user_id:Rs("nickname")=SoonBiz.user_nickname:Rs("stime")=now():Rs("ip")=SoonBiz.UserTrueIP:Rs("classid")=classid
End If:Rs("title")=title:Rs("content")=content:Rs("ispass")=SoonBiz.ispass:rs.update:thisid=rs("id"):fid="re"&thisid :rs.close:Set rs=Nothing
If isedit Then
Else:sql="update "& sheethead &"_message set renickname='"&SoonBiz.user_nickname&"'":sql=sql & ",reuserid="&SoonBiz.user_id:sql=sql & ",reps=reps+1":sql=sql & ",retime="& soonbizcom:sql=sql & " where id="&forumid:SoonBiz.execute(sql):SoonBiz.execute("update "& sheethead &"_class set postnum=postnum+1,todaynum=todaynum+1 where id="&classid):SoonBiz.loadclass:sql="update "& sheethead &"_user set user_repost=user_repost+1 where id="&SoonBiz.user_id:SoonBiz.execute(sql)'theircouldonthemsaid:]himoursee:an[~:formany:"
If remessagepoint>0 Then
SoonBiz.DoPoint remessagepoint,SoonBiz.user_id,SoonBiz.user_nickname,cid,thisid,"回贴加分",""
End If
End If:SoonBiz.Delxml SoonBiz.Getxn("read",cid,classid,id,topicid,0):session("codestr")="" :Sucmsg="<li>保存成功</li>"
If isedit Then
SoonBiz.success(Sucmsg)':herecamecomebetweenhave_anothergot~after|mostbutforabouttheyanother:
Else:SoonBiz.nok
End If:End Sub:Private Sub checkclose(num) :Dim rs:Set rs=SoonBiz.execute("select islock from "& sheethead &"_message where id="&num)
If rs.eof Then ShowErr(1018)
If CLng(Rs("islock"))=1 Then ShowErr("这个主题已经关闭,禁止回复")
rs.close:Set rs=Nothing:End Sub
%>
