<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<!--#include file="forbbs.asp"-->
<%call head()
dim bbsid,txt,title,fs,vote,cent,up,face,reContent,centnums,vscent
bbsid=usb(request("bbsid"))
if bbsid="" or Isnumeric(bbsid)=False Then

  Call Error("<card title=""出错""><p>ID无效！")
  end If
  
    num222=request.form("num22")
  num111=request.form("num11")
  dim cityon
  set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select sellkf,city from ydbbs where id="&bbsid,conn,1,1
if rs.eof then
  Call Error("<card title=""出错""><p>无此论坛！")
end if



if rs("sellkf")=1 then 
  Call Error("<card title=""出错""><p>本版禁止发帖！")
end if
cityon=rs("city")
rs.close
set rs=nothing

Sub Fortxtsell
if bbsid<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select bbsid,strsell,strall from hmd where bbsid="&bbsid&" and guliid="&myid,conn,1,1
if not rs.eof then
if rs("strsell")>0 then
 Call Error("<card title=""出错""><p>你在本版已被禁言！")
  end if
if rs("strall")>0 then
 Call Error("<card title=""出错""><p>你在本版已被加黑！")
  end if
end if
rs.close
set rs=nothing
end if

set rs=server.createobject("adodb.recordset")
rs.open "select bbsid,strsell,strall from hmd where bbsid=0 and guliid="&myid,conn,1,1
if not rs.eof then
if rs("strsell")>0 then
 Call Error("<card title=""出错""><p>你已被禁言！")
  end if
if rs("strall")>0 then
 Call Error("<card title=""出错""><p>你已被加黑！")
  end if
end if
rs.close
set rs=nothing
end Sub
CALL Fortxtsell
title=request("title")
txt=request("txt")
txt=forbbs(txt)
reContent=request("reContent")
reContent=forbbs(reContent)
cent=request("cent")
face=request("face")
up=usb(request("up"))
vote=usb(request("vote"))
fs=request("fs")
centnums=request("centnums")
vscent=request("saytkcent")

if up="" or Isnumeric(up)=False then up=0
up=up

if title="" then 
Call saycarda("出错")
  Call Error("标题不能为空！")
  end if
if txt="" then 
Call saycarda("出错")
  Call Error("内容不能为空！")
  end if

if len(title)<2 then 
Call saycarda("出错")
  Call Error("标题不能少于2字！")
  end if

if len(title) > 30 Then
Call saycarda("出错")
  Call Error("标题不能多于30字！")
  end if

if len(txt)<10 Then
Call saycarda("出错")
  Call Error("内容不能少于10字！")
  end if

if len(txt) > 50000 Then
Call saycarda("出错")
  Call Error("内容不能多于50000字！请用续帖功能或者2.0上传！")
  end if

if maren(title & txt) >0 Then
Call saycarda("出错")
  Call Error("请文明用语，不要讲粗话，谢谢！")
end if


if cent="" or Isnumeric(cent)=False then cent=0

if cent>1000000 then 
Call saycarda("出错")
  Call Error("金币不能大于1000000！")
  end if
if len(reContent)>1000 then
  Call Error("隐藏内容不能多于1000字！")
  end if

IF reContent<>"" then
if reContent="" then 
Call saycarda("出错")
  Call Error("隐藏内容不能为空！")
  end if
end if
IF up=5 then
if centnums = "" or IsNumeric(centnums) = False then
 Call saycarda("出错")
  Call Error(""&getcent&"数量错误1！")
end if
if vscent = "" or IsNumeric(centnums) = False Then
Call saycarda("出错")
  Call Error(""&getcent&"数量错误.！")
end if
if abs(int(myjb))-abs(int(centnums))<0 Then
Call saycarda("出错")
  Call Error(""&getcent&"不足.！")
end if
if centnums<50 Then
Call saycarda("出错")
  Call Error("派币总额最少50"&getcent&"！")
end if
if vscent<10 Then
Call saycarda("出错")
  Call Error("每人最少派10"&getcent&"！")
end if
'扣币
conn.execute("update Users Set myjb = myjb -"&centnums&" where ID="&myid)

else
centnums=0
vscent=0
END IF
Call cardz("发表帖子","board.asp?bbsid="&bbsid&"&amp;sid="&sid&"&amp;saytk="&saytk&"")



set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [sell] where name='"&title&"' and fid="&myid,conn,1,2
if not rs.eof then
  Call Error("重复发帖！")
  end if
rs.addnew
IF up=4 then
if txt<>"" then rs("txt")=txt&"(re)"&reContent&"(/re)"
else
if txt<>"" then rs("txt")=txt
end if
rs("name")=title
rs("fs")=fs
rs("lx")=up
rs("touu")=face
rs("fid")=myid
rs("paycent")=cent
rs("fname")=myni
rs("bbsid")=bbsid
rs("Price")    = centnums
rs("PaiCent")     = vscent
rs("Freyuan")    = centnums
if up=2 then
if vote<>"" then rs("vote")=vote
if vote<>"" then
votes=split(utf8(vote),",")
voteid=""
for i=0 to ubound(votes)
if votes(i)<>"" then
voteid=voteid&"0,"
end if
next
rs("addvote")=voteid
end if
end if
rs("city")=cityon '同城,group标识
rs.update
rs.close
set rs=nothing
'取帖子ID
dim tid
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select top 1 ID from [sell] order by id desc",conn,1,1
tid=rs("ID")
rs.close
set rs=nothing
dim zt,jk,qqqjb,qqqjy,qqqch,qqqml,qqqtl,qqqxq,qqqjk,qqqpz,qqqsmk,qqqsmk2,qqqjkk,qqqjkk2,jkk
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select cwzt,cw,cwrq,cwsmk,cwjkk from Users where sid='"&RequestStr(sid)&"'",conn,1,1
pz=rs("cw")
zt=rs("cwzt")
jk=rs("cwrq")
smk=rs("cwsmk")
jkk=rs("cwjkk")
rs.close
set rs=nothing








if czt=1 and pz=1 then
qqqjb=longxi
qqqjy=longjy
qqqtl=fttl
qqqml=ftml
qqqch=ftch
qqqxq=longxq
qqqjk=longjk
qqqpz="携带龙系宠物"
qqqsmk="0"
qqqsmk1="0"
qqqjkk="0"
qqqjkk1="0"
else
if zt=1 and pz=7 then
qqqjb=tu
qqqjy=tujy
qqqtl=fttl
qqqml=ftml
qqqch=ftch
qqqxq=tuxq
qqqjk=tujk
qqqpz="携带兔子系宠物"
qqqsmk="0"
qqqsmk1="0"
qqqjkk="0"
qqqjkk1="0"
else
if zt=1 and pz=2 then
qqqjb=jing
qqqjy=jingjy
qqqtl=fttl
qqqml=ftml
qqqch=ftch
qqqxq=jingxq
qqqjk=jingjk
qqqpz="携带精灵系宠物"
qqqsmk="0"
qqqsmk1="0"
qqqjkk="0"
qqqjkk1="0"
else
if zt=1 and pz=3 then
qqqjb=niao
qqqjy=niaojy
qqqxq=niaoxq
qqqjk=niaojk
qqqtl=fttl
qqqml=ftml
qqqch=ftch
qqqpz="携带鸟系宠物"
qqqsmk="0"
qqqsmk1="0"
qqqjkk="0"
qqqjkk1="0"
else
if zt=1 and pz=4 then
qqqjb=mao
qqqjy=maojy
qqqxq=maoxq
qqqjk=maojk
qqqtl=fttl
qqqml=ftml
qqqch=ftch
qqqpz="携带猫系宠物"
qqqsmk="0"
qqqsmk1="0"
qqqjkk="0"
qqqjkk1="0"
else
if zt=1 and pz=5 then
qqqjb=xiong
qqqjy=xiongjy
qqqxq=xiongxq
qqqjk=xiongjk
qqqtl=fttl
qqqml=ftml
qqqch=ftch
qqqpz="携带熊猫系宠物"
qqqsmk="0"
qqqsmk1="0"
qqqjkk="0"
qqqjkk1="0"
else
if zt=1 and pz=6 then
qqqjb=qingwa
qqqjy=qingwajy
qqqxq=qingwaxq
qqqjk=qingwajk
qqqtl=fttl
qqqml=ftml
qqqch=ftch
qqqpz="携带青蛙系宠物"
qqqsmk="0"
qqqsmk1="0"
qqqjkk="0"
qqqjkk1="0"
else

if zt=2 and smk>0 then
qqqjb=ftjb
qqqjy=ftjy
qqqxq="0"
qqqjk="0"
qqqtl=fttl
qqqml=ftml
qqqch=ftch
qqqpz="使用宠物生命卡"
qqqsmk="1"
qqqsmk1=smk1
qqqjkk="0"
qqqjkk1="0"
else

if zt=3 and jkk>0 then
qqqjb=ftjb
qqqjy=ftjy
qqqxq="0"
qqqjk="0"
qqqtl=fttl
qqqml=ftml
qqqch=ftch
qqqpz="使用宠物智力卡"
qqqsmk="0"
qqqsmk1="0"
qqqjkk="1"
qqqjkk1=jkk1
end if
end if
end if
end if
end if
end if
end if
end if
end if


if myid<>0 then
mz="[url=/bbs/uinfo.asp?id="&myid&"&amp;saytk="&saytk&"&sid=[sid]]"&myni&"[/url]"
else
mz="游客"
end if
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select name from sell where yc=0 and id=" & tid,conn,1,1
conn.execute("insert into sqdt(shijian,dz)values('"&now&"','"&mz&"发表了帖子(url=/bbs/topic.asp?tid="&tid&"&amp;saytk="&saytk&"&sid=[sid])"&ubb(rs("name"))&"(/url)')")
rs.close
set rs=nothing

if zt=1 and jk=>11 or zt=2 and smk=>1 or zt=3 and jkk=>1 then
conn.execute("update Users set myjb=myjb+"&qqqjb&",myjy=myjy+"&qqqjy&",mytl=mytl+"&qqqtl&",myml=myml+"&qqqml&",mych=mych+"&qqqch&",cwxq=cwxq+"&qqqxq&",cwrq=cwrq+"&qqqjk&",cwsmk=cwsmk-"&qqqsmk&",cwsm=cwsm+"&qqqsmk1&",cwjkk=cwjkk-"&qqqjkk&",cwzs=cwzs+"&qqqjkk1&",myrelnum = myrelnum+1 where ID="&myid)
conn.close
set conn=nothing

response.write "您"&qqqpz&"发表帖子成功!奖励"&ftjb&getcent&","&ftjy&"经验<br/>"
response.write "宠物心情+"&qqqxq&",健康+"&qqqjk&",智力+"&qqqjkk1&"生命+"&qqqsmk1&"<br/>宠物生命卡-"&qqqsmk&",宠物智力卡-"&qqqjkk&"<br/>"
response.write "<a href=""topic.asp?tid="&tid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">查看帖子</a>"
Else
conn.execute("update Users set myjb=myjb+"&ftjb&" where ID="&myid&"")
conn.execute("update Users set myjy=myjy+"&ftjy&" where ID="&myid&"")
conn.execute("update Users set mytl=mytl+"&fttl&" where ID="&myid&"")
conn.execute("update Users set myml=myml+"&ftml&" where ID="&myid&"")
conn.execute("update Users set mych=mych+"&ftch&" where ID="&myid&"")
conn.execute("update Users set mysellnum = mysellnum+1 where ID="&myid&"")
conn.close
set conn=nothing
if zt=1 and jk<=10 then

response.write "您的宠物已经死亡!携带宠物无效!<br/>"
else
if zt=2 and smk<=0 then

response.write "您的生命卡已经使用完了~~!<br/>"
else
if zt=3 and jkk<=0 then

response.write "您的智力卡已经使用完了~~!<br/>"
end if
end if
end if
response.write "您发表帖子成功..(3秒后自动返回)<br/>奖励"&ftjb&getcent&","&ftjy&"经验<br/>"
response.write "<a href=""topic.asp?tid="&tid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">查看帖子</a>"


end if








response.write "<br/><a href='board.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>返回本版</a>"%>
<!--#include file="fanhui.asp"-->
<%Call headsay()%>