<!--#include file="../conn.asp"-->
<!-- #include file="../admin/check_master.asp" -->
<!--#include file="../inc/publicfun.asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/xmwuye.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
function selectAll()  //全选
{
	var f=document.selectform
	var box=f.checkbox1
    var length=0
	if(box && !box[0]){length=1}
	if(box[0]){length=box.length}

    if (length == 0 ){return;}
    if (length ==1 ){box.checked=true;}
    if (length>1){
      for (var i = 0; i < length; i++){
        box[i].checked=true;
       }
    }
}

function selectRev()  //反选
{
	var f=document.selectform
	var box=f.checkbox1
    var length=0
	if(box && !box[0]){length=1}
	if(box[0]){length=box.length}

    if (length == 0 ){return;}
    if (length ==1 ){box.checked=!(box.checked);}
    if (length>1){
      for (var i = 0; i < length; i++){
        box[i].checked=!box[i].checked;
       }
    }

}

</script>
<%
searchcontent=trim(request("searchcontent"))'搜索内容
searchkind=request("searchkind")'搜索类别
searchmethod=request("searchmethod")'搜索方式
BoardID_1=request("BoardID_1")'主论坛
BoardID_2=request("BoardID_2")'分论坛

tyname1="searchcontent"
tyvalue1=searchcontent
tyname2="searchkind"
tyvalue2=request("searchkind")
if searchmethod="" then
	sql="select * from bbstitle order by id desc"
else
	select case searchmethod
		case "1"
			select case searchkind
				case "id"
					sql="select * from bbstitle where id="&searchcontent&" order by id desc"
				case "user_id"
					sql="select * from bbstitle where user_id='"&searchcontent&"' order by id desc"
				case "title"
					sql="select * from bbstitle where title like '%"&searchcontent&"%' order by id desc"
				case "ip"
					sql="select * from bbstitle where ip ='"&searchcontent&"' order by id desc"
			end select

	   case "2"
			if BoardID_1="" then
				if Searchkind="huati" then'话题
					sql="select * from bbstitle where huati>=1 order by id desc"
				elseif Searchkind="bbs_img" then'图片1
					sql="select * from bbstitle where bbs_img<>'' order by id desc"
				elseif Searchkind="img_url" then'图片2
					sql="select * from bbstitle where img_url<>'' order by id desc"
				else
					sql="select * from bbstitle where "&Searchkind&"=1 order by id desc"
				end if
			else
				if BoardID_2="" then
					if Searchkind="" then
						sql="select * from bbstitle where BoardID_1='"&BoardID_1&"' order by id desc"
					elseif Searchkind="huati" then'话题
						sql="select * from bbstitle where BoardID_1='"&BoardID_1&"' and huati>=1 order by id desc"
					elseif Searchkind="bbs_img" then'图片1
						sql="select * from bbstitle where BoardID_1='"&BoardID_1&"' and bbs_img<>'' order by id desc"
					elseif Searchkind="img_url" then'图片2
						sql="select * from bbstitle where BoardID_1='"&BoardID_1&"' and img_url<>'' order by id desc"
					else
						sql="select * from bbstitle where BoardID_1='"&BoardID_1&"' and "&Searchkind&"=1 order by id desc"
					end if
				else
					if Searchkind="" then
						sql="select * from bbstitle where BoardID_1='"&BoardID_1&"' and BoardID_2='"&BoardID_2&"' order by id desc"
					elseif Searchkind="huati" then'话题
						sql="select * from bbstitle where BoardID_1='"&BoardID_1&"' and BoardID_2='"&BoardID_2&"' and huati>=1 order by id desc"
					elseif Searchkind="bbs_img" then'图片1
						sql="select * from bbstitle where BoardID_1='"&BoardID_1&"' and BoardID_2='"&BoardID_2&"' and bbs_img<>'' order by id desc"
					elseif Searchkind="img_url" then'图片2
						sql="select * from bbstitle where BoardID_1='"&BoardID_1&"' and BoardID_2='"&BoardID_2&"' and img_url<>'' order by id desc"
					else
						sql="select * from bbstitle where BoardID_1='"&BoardID_1&"' and BoardID_2='"&BoardID_2&"' and "&Searchkind&"=1 order by id desc"
					end if

				end if
			end if
	end select
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,3,1
'当前地址
'return_url=request.serverVariables("HTTP_REFERER")
return_url="title_manage.asp?searchmethod="&searchmethod&"%26BoardID_1="&BoardID_1&"%26BoardID_2="&BoardID_2&"%26searchkind="&searchkind&"%26searchcontent="&searchcontent&"%26page="&page
%>

<script LANGUAGE="javascript">
<!--

var onecount;
onecount=0;
var j;
  
subcat = new Array();
<%
strsql="select BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Name from BBS_Cate where BBS_Cate_PID<>'0' order by BBS_ID asc"
set rsr_BBS_Cate=server.createobject("adodb.recordset")
rsr_BBS_Cate.open strsql,conn,3,1
j=0
do while not rsr_BBS_Cate.eof
%>
subcat[<%=j%>] = new Array("<%=rsr_BBS_Cate("BBS_Cate_Name")%>","<%=rsr_BBS_Cate("BBS_Cate_PID")%>","<%=rsr_BBS_Cate("BBS_Cate_ID")%>");
<%
j=j+1
rsr_BBS_Cate.movenext
loop
rsr_BBS_Cate.close
set rsr_BBS_Cate=nothing
%>

onecount=<%=j%>;

function changelocation(locationid)
    {
    document.myform.BoardID_2.length = 0; 

    var locationid=locationid;
    var i;
    document.myform.BoardID_2.options[0] = new Option('==分论坛==','');
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
            document.myform.BoardID_2.options[document.myform.BoardID_2.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    

//-->
</script>
<table width="99%" border="0" align="center">
  <TR align=center>
<FORM METHOD=POST ACTION="title_manage.asp" >
	  <TD> 
        搜索：<INPUT TYPE="text" NAME="searchcontent" size=20>
        <select name="searchkind">
          <option value="id">ID号</option>
          <option value="user_id">用户名</option>
          <option value="title">标  &nbsp;题</option>
          <option value="ip">IP地址</option>
        </select>
		<INPUT TYPE="hidden" name="searchmethod" value="1">
        <INPUT TYPE="submit" value="搜索" name="">
          </TD>
</FORM>
</TR>
</TABLE>
<table width="99%" border="0" align="center">
  <TR align=center>

<FORM name="myform" METHOD=POST ACTION="title_manage.asp" >
 <TD> 
<SELECT NAME="BoardID_1" onChange="changelocation(document.myform.BoardID_1.options[document.myform.BoardID_1.selectedIndex].value)">
<option value="">==主论坛==</option>
<%
str="select BBS_Cate_ID,BBS_Cate_Name from BBS_CATE Where BBS_Cate_PID='0' order by BBS_ID asc"
set rs_BBS_Cate=server.createobject("adodb.recordset")
rs_BBS_Cate.open str,conn,1,1
do while not rs_BBS_Cate.eof
%>
	<option value="<%=rs_BBS_Cate("BBS_Cate_ID")%>"><%=rs_BBS_Cate("BBS_Cate_Name")%></option>
<%
rs_BBS_Cate.movenext
loop
rs_BBS_Cate.close
set rs_BBS_Cate=nothing

%>
</SELECT>
<SELECT NAME="BoardID_2">
<option value="">==分论坛==</option>
</SELECT>
 <select name="searchkind">
          <option value="">全部</option>
          <option value="sign">推荐话题</option>
          <option value="bbstop">置顶贴子</option>
          <option value="huati">精华贴子</option>
          <option value="bbs_img">贴子图片</option>
		  </select>
		<INPUT TYPE="hidden" name="searchcontent" value="">
		<INPUT TYPE="hidden" name="searchmethod" value="2">
        <INPUT TYPE="submit" value="搜索" name=""></TD>
</FORM>
</TR>
</TABLE>
</center></div>
<!--<a href="bbs_huati_send.asp">【发布楼市话题】</a>-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%">
          <div align="center">
            
        <table border="0" cellspacing="1" width="100%" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0" bgcolor="#6D6576">
          <tr bgcolor="#f8f8f8"> 
            <td align="center" height="20"><strong>选择</strong></td>
            <td align="center" height="20"><strong>ID号</strong></td>
            <td width="48" align="center"><strong>主论坛</strong></td>
            <td width="48" align="center"><strong>分论坛</strong></td>
            <td width="45" align="center"><strong>用户名</strong></td>
            <td align="center"><strong>题目</strong></td>
            <td width="55" align="center"><strong>IP</strong></td>
            <td width="25" align="center"><strong>点击数</strong></td>
            <td width="25" align="center"><strong>回复数</strong></td>
            <td width="59" align="center"><strong>日期</strong></td>
			<td width="15" align="center"><strong>论坛头条</strong></td>
            <td width="15" align="center"><strong>论坛公告</strong></td>
            <td width="15" align="center"><strong>推荐话题</strong></td>
            <td width="15" align="center"><strong>首页显示</strong></td>
            <td width="14" align="center"><strong>精彩话题</strong></td>
            <td width="15" align="center"><strong>本版置顶</strong></td>
            <td width="15" align="center"><strong>总置顶</strong></td>
            <!--<td width="30" align="center" bgcolor="#D0D0D0"><strong>图片</strong></td>-->
            <td width="30" align="center"><strong>标志</strong></td>
            <!--<td width="25" align="center" bgcolor="#D0D0D0"><strong>修改</strong></td>-->
            <td width="25" align="center"><strong>删除</strong></td>
          </tr>
          <form name="selectform" method=post action="pldel.asp">
            <input type="hidden" name="op" value="选择转正">
            <input type="hidden" name="returnURL" value="title_manage.asp?<%=Request.QueryString%>">
            <script language="JavaScript">
  <!--
  function select_pl_submit(optype){
	var f=document.forms["selectform"]
	f.op.value=optype
	f.submit()
  }
  //-->
  </script>
<%
if not rs.eof then
wzrep =30
wzpage = clng(request.querystring("page"))
if len(wzpage) = 0 or wzpage = 0 then wzpage = 1
rs.PageSize=wzrep
rs.AbsolutePage=wzpage
wzpagecount=rs.PageCount
wzcount=rs.RecordCount
for i = 0 to wzrep-1
  if rs.eof then exit for
%>
            <tr height=20 bgcolor="#FFFFFF"> 
              <td height="23" >
<div align="center"> 
                  <input name="checkbox1" type="checkbox" id="checkbox1" value="<%=rs("id")%>">
                </div></td>
              <td ><A HREF="../ftbbs.asp?id=<%=rs("id")%>" target="_blank"><%=rs("id")%></A></td>
              <td align="center"> 
                <%
	str="select BBS_Cate_ID,BBS_Cate_Name from BBS_CATE Where BBS_Cate_ID='"&rs("BoardID_1")&"'"
	set rs_BBS_Cate_sub=server.createobject("adodb.recordset")
	rs_BBS_Cate_sub.open str,conn,1,1
	if not rs_BBS_Cate_sub.eof then
    response.write rs_BBS_Cate_sub("BBS_Cate_Name") 
    end if
    rs_BBS_Cate_sub.close
    set rs_BBS_Cate_sub=nothing
%>
              </td>
              <td align="center"> 
<%
if trim(rs("BoardID_2"))<>"" then
	str="select BBS_Cate_ID,BBS_Cate_Name from BBS_CATE Where BBS_Cate_ID='"&rs("BoardID_2")&"'"
	set rs_BBS_Cate_sub=server.createobject("adodb.recordset")
	rs_BBS_Cate_sub.open str,conn,1,1
	if not rs_BBS_Cate_sub.eof then
%>
                <A HREF="title_manage.asp?searchmethod=2&BoardID_1=<%=rs("BoardID_1")%>&BoardID_2=<%=rs("BoardID_2")%>"><%=rs_BBS_Cate_sub("BBS_Cate_Name")%></A> 
<%
end if
rs_BBS_Cate_sub.close
set rs_BBS_Cate_sub=nothing
else
	response.write "&nbsp;"
end if
%>
              </td>
              <td align="center"><%=rs("user_id")%></td>
              <td align="center"><A HREF="reply_manage.asp?searchkind=pid&searchcontent=<%=rs("id")%>"><FONT  COLOR="blue"><%=rs("title")%></FONT></A></td>
              <td align="center"><%=rs("ip")%></td>
              <td align="center"><%=rs("hit")%></td>
              <td align="center"><%=rs("rep")%></td>
              <td align="center"><%=rs("dateh")%></td>
              <td align="center"> 
                <%if rs("boardsign")=2 then%>
                <A HREF="jportj.asp?id=<%=rs("id")%>&mode=0&kind=4&return_url=<%=return_url%>"><FONT COLOR="red">是</FONT></A> 
                <%else%>
                <A HREF="jportj.asp?id=<%=rs("id")%>&mode=2&kind=4&return_url=<%=return_url%>">否</A> 
                <%end if%>
              </td>
              <td align="center"> 
                <%if rs("boardsign")=1 then%>
                <A HREF="jportj.asp?id=<%=rs("id")%>&mode=0&kind=4&return_url=<%=return_url%>"><FONT COLOR="red">是</FONT></A> 
                <%else%>
                <A HREF="jportj.asp?id=<%=rs("id")%>&mode=1&kind=4&return_url=<%=return_url%>">否</A> 
                <%end if%>
              </td>
              <td align="center"> 
                <%if rs("sign")=0 then%>
                <A HREF="jportj.asp?id=<%=rs("id")%>&mode=1&kind=1&return_url=<%=return_url%>"><FONT COLOR="green">否</FONT></A> 
                <%else%>
                <A HREF="jportj.asp?id=<%=rs("id")%>&mode=0&kind=1&return_url=<%=return_url%>"><FONT COLOR="red">是</FONT></A> 
                <%end if%>
              </td>
              <td align="center"> 
                <%if rs("showinhomepage")=0 then%>
                <A HREF="jportj.asp?id=<%=rs("id")%>&mode=1&kind=3&return_url=<%=return_url%>"><FONT COLOR="green">否</FONT></A> 
                <%else%>
                <A HREF="jportj.asp?id=<%=rs("id")%>&mode=0&kind=3&return_url=<%=return_url%>"><FONT COLOR="red">是</FONT></A> 
                <%end if%>
              </td>
              <td align="center"> 
                <%if rs("huati")=0 then%>
                <A HREF="jportj.asp?id=<%=rs("id")%>&mode=1&kind=2&return_url=<%=return_url%>"><FONT COLOR="green">否</FONT></A> 
                <%else%>
                <A HREF="jportj.asp?id=<%=rs("id")%>&mode=0&kind=2&return_url=<%=return_url%>"><FONT COLOR="red">是</FONT></A> 
                <%end if%>
              </td>
              <td align="center"> 
                <%if rs("bbstop")=1 then%>
                <A HREF="masterbbstop.asp?id=<%=rs("id")%>&bbstop=0"><FONT COLOR="green">是</FONT></A> 
                <%else%>
                <A HREF="masterbbstop.asp?id=<%=rs("id")%>&bbstop=1"><FONT COLOR="red">否</FONT></A> 
                <%end if%>
              </td>
              <td align="center"> 
                <%if rs("bbstop1")=1 then%>
                <A HREF="masterbbstop.asp?id=<%=rs("id")%>&bbstop1=0"><FONT COLOR="green">是</FONT></A> 
                <%else%>
                <A HREF="masterbbstop.asp?id=<%=rs("id")%>&bbstop1=1"><FONT COLOR="red">否</FONT></A> 
                <%end if%>
              </td>
              <td><div align="center"> 
                  <%if rs("deleted")=0 then%>
                  <A HREF="del_sign.asp?id=<%=rs("id")%>&mode=1&kind=2&return_url=<%=return_url%>"><FONT COLOR="green">显示</FONT></A> 
                  <%else%>
                  <A HREF="del_sign.asp?id=<%=rs("id")%>&mode=0&kind=2&return_url=<%=return_url%>"><FONT COLOR="red">隐藏</FONT></A> 
                  <%end if%>
                </div></td>
              <td > <p align="center"><a href="info_delete.asp?id=<%=rs("id")%>&filepath=<%=rs("htmfilename")%>&bbs_img=<%=rs("bbs_img")%>&ptuser=<%=rs("name")%>&return_url=<%=return_url%>" onclick="return confirm('确实要删除吗？');">删除</a></td>
            </tr>
<%
rs.movenext
next
rs.close
set rs=nothing
%>
            <tr bgcolor="#FFFFFF"> 
              <td height="22" colspan="21"> <input name="button" type="button" onclick="selectAll()" value="全选"> 
                <input name="button" type="button" onclick="selectRev()" value="反选"> 
                <input name="button" type="button" onclick="selectAll();selectRev()" value="全不选"> 
                <input name="button" type="button" onclick="select_pl_submit('选择删除')" value="将所选删除" <%if instr(session("admin_qs"),3)<=0 then%>disabled<%end if%>>
                <input name="button" type="button" onclick="select_pl_submit('精彩话题')" value="将所选设为精彩话题" <%if instr(session("admin_qs"),3)<=0 then%>disabled<%end if%>>
				<input name="button" type="button" onclick="select_pl_submit('推荐话题')" value="将所选设为推荐话题" <%if instr(session("admin_qs"),3)<=0 then%>disabled<%end if%>>
			  </td>
            </tr>
            <tr bgcolor="#FFFFFF"> 
              <td height="22" colspan="21"> 
                <input name="button" type="button" onclick="select_pl_submit('取消精彩话题')" value="将所选取消精彩话题" <%if instr(session("admin_qs"),3)<=0 then%>disabled<%end if%>>
				<input name="button" type="button" onclick="select_pl_submit('取消推荐话题')" value="将所选取消推荐话题" <%if instr(session("admin_qs"),3)<=0 then%>disabled<%end if%>>
			    <input name="button" type="button" onclick="select_pl_submit('选择显示')" value="将所选显示" <%if instr(session("admin_qs"),3)<=0 then%>disabled<%end if%>>
                <input name="button" type="button" onclick="select_pl_submit('选择隐藏')" value="将所选隐藏" <%if instr(session("admin_qs"),3)<=0 then%>disabled<%end if%>> 
              </td>
            </tr>
          </form>
          <tr> 
            <td align=center colspan=23 bgcolor="#EFEFEF" height=23> 
              <div align="right">&nbsp; 共<font color=red><%= wzcount%></font>记录<font color=red><%= wzrep%></font>/页 
                共<font color=red><%= wzpagecount%></font>页 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= FtbbsPage(wzpagecount,tyname1,tyvalue1,tyname2,tyvalue2)%> 
              </div></td>
          </tr>
<%else%>
          <tr bgcolor="#FFFFFF"> 
            <td align=center colspan=23 height=23> 
              <div align="right"> </div></td>
          </tr>
<%end if%>
        </table>
      </center></div>
    </td>
  </tr>
</table>
</body>
</html>
<%closedb%>