<!--#include file="../conn.asp"-->
<!-- #include file="../admin/check_master.asp" -->
<!--#include file="../admin/check_admin_qs.asp" -->
<%
op=Request("op")
del_count=request.form("checkbox1").count
returnURL=Request("returnURL")
PiLiangZhuanZheng
Sub PiLiangZhuanZheng
select case op
case "选择删除"
	idList=Trim(Request.Form("checkbox1"))
	if idList="" then
		exit sub
	end if
	for i=1 to del_count
		bbsid=request.form("checkbox1")(i)
	    sql2="select BoardID_1,BoardID_2,bbs_img,htmfilename from bbstitle where id="&bbsid
	    Set rs= Server.CreateObject("ADODB.Recordset")
        rs.open sql2,conn,1,1
	  if not rs.eof then
	    BoardID_1=rs("BoardID_1")
	    BoardID_2=rs("BoardID_2")
        fldarray=split(rs("htmfilename"),"/",-1,1)
        infolder=fldarray(0)
        FiLePaTh = Server.MapPath("../")& rs("htmfilename")
        Set fso = CreateObject("Scripting.FileSystemObject")
		If fso.FileExists(FiLePaTh) = True Then
           fso.DeleteFile(FiLePaTh)
		end if
        Set fso = nothing
        if rs("bbs_img")<>"" then
        '以下是删除图片文件
        FiLePaTh = Server.MapPath("../")& infolder&"\" &rs("bbs_img")
        Set fso = CreateObject("Scripting.FileSystemObject")
		If fso.FileExists(FiLePaTh) = True Then
           fso.DeleteFile(filepath)
		end if
        Set fso = nothing   
        end if
		rs.close
		sql="delete from bbstitle where id="&bbsid
		conn.execute(sql)
        sql="delete from bbsmenu where pid="&bbsid
        conn.execute sql
		sql="update BBS_Cate set BBS_Cate_Topic=BBS_Cate_Topic-1 where BBS_Cate_Topic>0 and BBS_Cate_ID='"&BoardID_1&"'"
        conn.execute sql
		sql="update BBS_Cate set BBS_Cate_Topic=BBS_Cate_Topic-1 where BBS_Cate_Topic>0 and BBS_Cate_ID='"&BoardID_2&"'"
        conn.execute sql
	  end if
	next
	conn.close
	Response.Redirect returnURL
case "精彩话题"
	idList=Trim(Request.Form("checkbox1"))
	if idList="" then
		exit sub
	end if
	for i=1 to del_count
		bbsid=request.form("checkbox1")(i)
		sql="update bbstitle set huati=1 where id="&bbsid
        conn.execute sql
	next
	conn.close
	Response.Redirect returnURL
case "推荐话题"
	idList=Trim(Request.Form("checkbox1"))
	if idList="" then
		exit sub
	end if
	for i=1 to del_count
		bbsid=request.form("checkbox1")(i)
		sql="update bbstitle set sign=1 where id="&bbsid
        conn.execute sql
	next
	conn.close
	Response.Redirect returnURL
case "取消精彩话题"
	idList=Trim(Request.Form("checkbox1"))
	if idList="" then
		exit sub
	end if
	for i=1 to del_count
		bbsid=request.form("checkbox1")(i)
		sql="update bbstitle set huati=0 where id="&bbsid
        conn.execute sql
	next
	conn.close
	Response.Redirect returnURL
case "取消推荐话题"
	idList=Trim(Request.Form("checkbox1"))
	if idList="" then
		exit sub
	end if
	for i=1 to del_count
		bbsid=request.form("checkbox1")(i)
		sql="update bbstitle set sign=0 where id="&bbsid
        conn.execute sql
	next
	conn.close
	Response.Redirect returnURL
case "选择显示"
	idList=Trim(Request.Form("checkbox1"))
	if idList="" then
		exit sub
	end if
	for i=1 to del_count
		bbsid=request.form("checkbox1")(i)
		sql="update bbstitle set deleted=0 where id="&bbsid
        conn.execute sql
	next
	conn.close
	Response.Redirect returnURL
case "选择隐藏"
	idList=Trim(Request.Form("checkbox1"))
	if idList="" then
		exit sub
	end if
	for i=1 to del_count
		bbsid=request.form("checkbox1")(i)
		sql="update bbstitle set deleted=1 where id="&bbsid
        conn.execute sql
	next
	conn.close
	Response.Redirect returnURL
end select
End Sub
%>