<!-- #include file="../Inc.asp" -->
<!-- #include file="../ydzq.asp" -->
<!-- #include file="conn.asp" -->
<%

call Head()
dim titt,txt
titt=usb(request.form("titt"))
txt=usb(request.form("txt"))
rc=usb(request.form("rc"))
yc=usb(request.form("yc"))
IPent=request.serverVariables("REMOTE_ADDR")
if titt="" then
  Call Error("出错啦","标题不能为空！")
end if
if txt="" then
  Call Error("出错啦","内容不能为空！")
end if
if len(titt) > 54 then
  Call Error("出错啦","不能超过54个字符！")
  end if
if len(titt) < 4 then 
  Call Error("发布日志","日志标题不能少于4字！")
  end if
if len(txt) < 8 then
  Call Error("发布日志","日志内容不能少于8字！")
  end if
if len(txt) > 5000 then
  Call Error("出错啦","内容不能超过5000个字符!")
  end if
if maren(titt & txt) >0 then
  Call Error("发布日志","请文明用语，不要讲粗话，谢谢！")
end if

set rs=server.createobject("ADODB.Recordset")
rs.open"select zonerjflName from zonerjfl where userid="&myid&" order by id asc",conn,1,1
if rs("zonerjflName")="" then
  Call Error("出错啦","请先<a href=""fladd.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">添加</a>分类")
end if
rs.close
set rs=Nothing


set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [zonerj]",conn,1,2
rs.addnew
rs("uid")=myid
rs("tit")=titt
rs("txt")=txt
rs("rc")=rc
rs("yc")=yc
rs("tm")=now()
rs.update
rs.close
set rs=Nothing
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.open"select zoneyulou_tm,zoneyulou_a from [zone] where [zoneid]="& myid,conn,1,1
zoneyulou_tm=rs2("zoneyulou_tm")
zoneyulou_a=rs2("zoneyulou_a")
if zoneyulou_tm<>date() then
conn.Execute("update zone set zoneyulou_tm='"&date()&"',zoneyulou = zoneyulou+3,zoneyulou_a = 3  Where zoneid=" & myid)
else
if zoneyulou_a>=8 then
conn.Execute("update zone set zoneyulou=zoneyulou,zoneyulou_a = 8  Where zoneid=" & myid)
else
if zoneyulou_a+3 >= 8 then
conn.Execute("update zone set zoneyulou = zoneyulou+zoneyulou_a+3-7,zoneyulou_a = 8  Where zoneid=" & myid)
else
conn.Execute("update zone set zoneyulou = zoneyulou+3,zoneyulou_a = zoneyulou_a+3  Where zoneid=" & myid)
end if
end if
end if
rs2.close
set rs2=Nothing
'提取内容
dim rst,id
set rst=Server.CreateObject("ADODB.Recordset")
rst.open"select top 1 ID,tit from [zonerj] order by id desc",conn,1,1
id=rst("id")
rst.close
set rst=nothing
dim rsfrdt
set rsfrdt=Server.CreateObject("ADODB.Recordset")
rsfrdt.open"select * from frzonedt",conn,1,2
rsfrdt.addnew
rsfrdt("txt")="[url=index.asp?uid="&myid&"&amp;saytk=[saytk]&amp;sid=[sid]]"&myni&"[/url]"
rsfrdt("fgid")=myid
rsfrdt("rjid")=id
rsfrdt("rc")=1
rsfrdt("htm")=now()
rsfrdt.update
rsfrdt.close
set rsfrdt=nothing
conn.close
set conn=nothing
call zonecardy("发布成功","blog_view.asp?id="&id&"&amp;uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"")
if myid=clng(uid) then
response.write "<a href=""index_gl.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">个人中心</a>|"
end if
response.write "<a href=""index.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">主页</a>|"&_
               "<a href='blog.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>日志</a>|"&_
               "<a href='user_info.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>个人档</a><br/>"&_
               "恭喜恭喜!发布成功！<br/>"&_
               "<a href=""blog_view.asp?id="&id&"&amp;uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">正在返回查看新日志…</a><br/>"
call zoneLast()


'====================================


Function zone()

dim titt,txt
titt=usb(request.form("titt"))
txt=usb(request.form("txt"))
rc=usb(request.form("rc"))
yc=usb(request.form("yc"))
IPent=request.serverVariables("REMOTE_ADDR")
if titt="" then
  Call Error("出错啦","标题不能为空！")
end if
if txt="" then
  Call Error("出错啦","内容不能为空！")
end if
if len(titt) > 54 then
  Call Error("出错啦","不能超过54个字符！")
  end if
if len(titt) < 4 then 
  Call Error("发布日志","日志标题不能少于4字！")
  end if
if len(txt) < 8 then
  Call Error("发布日志","日志内容不能少于8字！")
  end if
if len(txt) > 5000 then
  Call Error("出错啦","内容不能超过5000个字符!")
  end if
if maren(titt & txt) >0 then
  Call Error("发布日志","请文明用语，不要讲粗话，谢谢！")
end if
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select tit from zonerj where uid = "&myid&" and tit='"&titt&"'",conn,1,1
if not rs.eof then
  rs.close
 set rs=Nothing
  Call Error("出错啦","请勿重复发表日志")
end if
set rs=server.createobject("ADODB.Recordset")
rs.open"select zonerjflName from zonerjfl where userid="&myid&" order by id asc",conn,1,1
if rs("zonerjflName")="" then
  Call Error("出错啦","请先<a href=""fladd.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">添加</a>分类")
end if
rs.close
set rs=Nothing


set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [zonerj]",conn,1,2
rs.addnew
rs("uid")=myid
rs("tit")=titt
rs("txt")=txt
rs("rc")=rc
rs("yc")=yc
rs("tm")=now()
rs.update
rs.close
set rs=Nothing
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.open"select zoneyulou_tm,zoneyulou_a from [zone] where [zoneid]="& myid,conn,1,1
zoneyulou_tm=rs2("zoneyulou_tm")
zoneyulou_a=rs2("zoneyulou_a")
if zoneyulou_tm<>date() then
conn.Execute("update zone set zoneyulou_tm='"&date()&"',zoneyulou = zoneyulou+3,zoneyulou_a = 3  Where zoneid=" & myid)
else
if zoneyulou_a>=8 then
conn.Execute("update zone set zoneyulou=zoneyulou,zoneyulou_a = 8  Where zoneid=" & myid)
else
if zoneyulou_a+3 >= 8 then
conn.Execute("update zone set zoneyulou = zoneyulou+zoneyulou_a+3-7,zoneyulou_a = 8  Where zoneid=" & myid)
else
conn.Execute("update zone set zoneyulou = zoneyulou+3,zoneyulou_a = zoneyulou_a+3  Where zoneid=" & myid)
end if
end if
end if
rs2.close
set rs2=Nothing
'提取内容
dim rst,id
set rst=Server.CreateObject("ADODB.Recordset")
rst.open"select top 1 ID,tit from [zonerj] order by id desc",conn,1,1
id=rst("id")
rst.close
set rst=nothing
dim rsfrdt
set rsfrdt=Server.CreateObject("ADODB.Recordset")
rsfrdt.open"select * from frzonedt",conn,1,2
rsfrdt.addnew
rsfrdt("txt")="<a href=""index.asp?uid="&myid&"&amp;sid=[sid]"">"&myni&"</a>"
rsfrdt("fgid")=myid
rsfrdt("rjid")=id
rsfrdt("rc")=1
rsfrdt("htm")=now()
rsfrdt.update
rsfrdt.close
set rsfrdt=nothing
conn.close
set conn=nothing
call zonecardy("发布成功","blog_view.asp?id="&id&"&amp;uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"")
if myid=clng(uid) then
response.write "<a href=""index_gl.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">个人中心</a>|"
end if
response.write "<a href=""index.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">主页</a>|"&_
               "<a href='blog.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>日志</a>|"&_
               "<a href='user_info.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>个人档</a><br/>"&_
               "恭喜恭喜!发布成功！<br/>"&_
               "<a href=""blog_view.asp?id="&id&"&amp;uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">正在返回查看新日志…</a><br/>"
call zoneLast()

End Function
call headsay()
%>
