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

<%
call head()
Call saycarda("专题")



dim bbsid,Action,ID
 bbsid=request.querystring("bbsid")
 id=request.querystring("id")
 Action=request("Action")
   if id="" or Isnumeric(id)=False then
  Call Error("ID无效！")
  end if
 
  if bbsid="" or Isnumeric(bbsid)=False then
  Call Error("ID无效！")
  end if
if keys=1 or skey=abs(bbsid) or keys=2 then
else
Call Error("权限不足!")
End if
  
  if Action<>"" then
  dim title,pid
  title=request("title")
   pid=request("pid")
    if pid="" or Isnumeric(pid)=False then
  Call Error("排序无效！")
  end if
  if title="" then
  Call Error("各项不能为空！")
  end if
  if len(title)>30 then
  Call Error("名称最多30字")
  end if
  set rs=server.createobject("adodb.recordset")
  rs.open" select * from bbszt where bbsid="&bbsid&" and ID="&ID,conn,1,2
  if rs.eof then
  Call Error("不存在的记录！")
  end if
  rs("title")=title
  rs("pid")=pid
  rs.update
  rs.close
  set rs=nothing
  response.write"编辑专题成功!"
  else
    set rs=server.createobject("adodb.recordset")
  rs.open" select * from bbszt where bbsid="&bbsid&" and ID="&ID,conn,1,1
    if rs.eof then
  Call Error("不存在的记录！")
  end if
if saytk=>2 Then
Response.write "<form name=""form"" method=""post"" action=""ztedit.asp?bbsid="&bbsid&"&amp;id="&id&"&amp;sid="&sid&"&amp;saytk="&saytk&""">"
End if%>
专题名称:<br/><input name="title" title="名称" value="<%=ubb(rs("title"))%>"/><br/>
排序:<br/><input name="pid" title="排序" value="<%=ubb(rs("pid"))%>"/><br/>
<%if saytk=>2 Then
response.write "<input type=""hidden"" name=""action"" value=""ok""/>"
%>

<input type="submit" name="Submit" value="确认"></form><br/><%
Else%>
<anchor>确认编辑
    <go href="ztedit.asp?bbsid=<%=bbsid%>&amp;id=<%=id%>&amp;sid=<%=sid%>&saytk=<%=saytk%>" method="post" accept-charset="utf-8">
        <postfield name="title" value="$(title)"/>  
        <postfield name="pid" value="$(pid)"/>   
        <postfield name="action" value="ok"/>  
    </go>
</anchor>
<%End if
rs.close
set rs=nothing
end if
conn.close
set conn=nothing
Response.write "<br/><a href=""bbszt.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">本版专题</a>"
Response.write "<br/><a href=""board.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">返回本版</a>"
Call headsay()%>
