<!--#include file="conn.asp" -->
<%
strCurrMenu="⑨menuid⑨"
ThisPage=request.ServerVariables("URL")
strQuery=""
strTitle="最新发布"
if GetVariable("class")<>"" then
	SourCode=conn.execute("Select c_code From web_news_class Where mn_id=" & strCurrMenu & " and id="&GetVariable("class"))(0)
	strQuery=strQuery & " And c_code Like '" & SourCode &"%'"
	strTitle=GetVariable("classname")
end if

if GetVariable("key")<>"" then
	strQuery=strQuery & " And (nTitle Like '%" & GetVariable("key") & "%' or nHtmlText like '%" & GetVariable("key") & "%' or nKey like '%" & GetVariable("key") & "%') "
	strTitle="搜索：" & GetVariable("key")
end if

'从这开始读数据
strSQL="Select * From v_web_news Where nAudit<>0 " & strQuery & " And mn_id=" & strCurrMenu & " Order by ID Desc"
rs.open strSQL,conn,1,1
'分页显示初始化
page=GetVariable("page")
if page="" then
	page=1
else
	page=Cint(page)
end if

Section=GetVariable("section")
if Section="" then
	Section=1
else
	Section=Cint(Section)
end if
'变量赋值
intPageSize=15		'每页显示记录数
intSectionSize=5		'多少页为一段，像GOOGLE一样
PrevSectionText="<FONT face=webdings>7</FONT>"		'上一段的链接文字
NextSectionText="<FONT face=webdings>8</FONT>"		'下一段的链接文字
PrevPageText="<FONT face=webdings>3</FONT>"			'上页的链接文字	
NextPageText="<FONT face=webdings>4</FONT>"			'下页的链接文字

strPageUrl="?class=" & GetVariable("class") & "&classname=" & GetVariable("classname") & "&key=" & GetVariable("key") & "&mnid=" & strCurrMenu

rs.pagesize=intPageSize
intCount=rs.RecordCount 
intPageCount=rs.pagecount
intSectionCount=(intPageCount - 1) \ intSectionSize + 1
if intCount>0 then
	rs.AbsolutePage=page 
end if 
%>


<html>
<head>
<title>⑨title⑨</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="common/style.css" type="text/css">
<style>
A:link{ color: #FFFFFF; text-decoration: none;}
A:visited{ color: #FFFFFF; TEXT-DECORATION: none;}
A:active{color: #FFFFFF; TEXT-DECORATION: none;}
A:hover{ color: #FFFFFF; TEXT-DECORATION: underline;}

A.#SubMenu:link{ color: #000000; text-decoration: none;}
A.#SubMenu:visited{ color: #000000; TEXT-DECORATION: none;}
A.#SubMenu:active{color: #000000; TEXT-DECORATION: none;}
A.#SubMenu:hover{ color: #000000; TEXT-DECORATION: underline;}

</style>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" BodyBegin><!--#include file="top.asp"-->
<table width="757" border="0" align="center" cellpadding="0" cellspacing="0" height="300">
  <tr> 
    <td width="535" valign="top" bgcolor="#F0F9FD"> 
      <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td height="15" bgcolor="#FFFFFF"><img src="images/new.gif" width="127" height="38"></td>
        </tr>
        <tr> 
          <td height="5" bgcolor="#FFFFFF"></td>
        </tr>
        <tr> 
          <td height="1" bgcolor="#666666"></td>
        </tr>
        <tr>
          <td height="8">&nbsp;</td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="8" align="center">
        <tr> 
          <td valign="top" height="36"> <table width="100%" border="0" align="center">
              <tr> 
                <td  height="8"></td>
              </tr>
              <tr> 
                <td  height="23">您的位置 : <a class=title01 
            href="."><font color="#000000">首页</font></a> <img src="images/image_24.gif" width="8" height="5"> 
                  <font face="Arial Black"><%=strTitle%></font></td>
              </tr>
              <tr> 
                <td height="1" background="images/linebg.gif"></td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td valign="top"> <table width="83%" border="0" align="center"  cellspacing="0" cellpadding="0">
              <%
										  '开始输出最新新闻
										   for i=1 to intPageSize
												if rs.eof then exit For
												if i mod 2 =0 then
													strColor="#FFFFFF"
												else
													strColor="#F9F9F9"
												end if
										  %>
              <tr> 
                <td height="27">· <a href="newshow.asp?id=<%=trim(rs("ID"))%>&mnid=<%=strCurrMenu%>&classname=⑨thispage⑨&uppage=<%=ThisPage%>" target="_blank" class="aBlack"><%=trim(rs("nTitle"))%></a> 
                  (<%=Year(rs("nTime")) & "-" & Month(rs("nTime")) & "-" & Day(rs("nTime"))%>) 
                </td>
              </tr>
              <tr> 
                <td background="images/line1.gif" height="1"></td>
              </tr>
              <%
											rs.movenext
										next
										%>
            </table>
            <table width="92%" border="0" align="center">
              <tr> 
                <td height="1" background="images/linebg.gif"></td>
              </tr>
              <tr> 
                <td height="20" align="right" > 
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td align="right"> 共有<%=intCount%>记录，分<%=intPageCount%>页，当前页<%=Page%>，每页显示<%=intPageSize%>条记录 
                        <%
			'计算每一段的开始页
			intStarPage=(Section-2) * intSectionSize + 1
			'前一段
			if Section<=1 then
				response.Write(PrevSectionText & " ")
			else
				response.Write("<a href='" & strPageUrl & "&page=" & intStarPage & "&section=" & Section-1 & "' class='aBlack'>" & PrevSectionText & "</a> ")
			end if 
			
			'显示页码列表
			response.Write("第")
			intStarPage=(Section-1) * intSectionSize + 1
		    for p=intStarPage to intStarPage + intSectionSize - 1
				if p > intPageCount then exit for
				if p=page then
		    		response.Write("<strong>[" & p & "]</strong> ")
				else
		    		response.Write("<a href='" & strPageUrl & "&page=" & p & "&section=" & Section & "' class='aBlack'>[" & p & "]</a> ")
				end if	
		    next
			response.Write("页")
			'后一段
			intStarPage=(Section) * intSectionSize + 1
			if Section>=intSectionCount then
				response.Write(" " & NextSectionText)
			else
				response.Write(" <a href='" & strPageUrl & "&page=" & intStarPage & "&section=" & Section+1 & "' class='aBlack'>" & NextSectionText & "</a> ")
			end if 
		  %>
                        　 </td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td height="23" align="right" >&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table> </td>
    <td width="220" bgcolor="#F9F4F8" valign="top"> 
      <table width="100%" border="0" cellpadding="0" cellspacing="3">
        <tr>
          <td height="31" bgcolor="#F5DCEC"> 
            <div align="center"><b><font size="2" class="fs-14px" color="#910000">⑨thispage⑨</font></b></div>
          </td>
        </tr>
      </table>
      <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
              <%
									'开始输出分类
									strcode=""
									for i=1 to Len(SourCode) \ 4
									strcode=strcode&" or c_code like '"&left(SourCode,i*4)&"____'"
									next
									if strcode<>"" then
									strcode="(1<>1"&strcode&" or Len(c_code)=4)"
									else
									strcode=" Len(c_code)=4"
									end if
									strSQL="Select * From web_news_class Where mn_id=" & strCurrMenu&" and " & strcode & "  Order by c_code"
									'response.Write(strsql)
									Set rsClass=Server.CreateObject("ADODB.RecordSet")
									rsClass.open strSQL,conn,1,1
									for i=1 to rsClass.recordcount
									Level=(Len(rsClass("c_code"))/4-1)*3
									%>
          <tr> 
            
          <td height="35" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>
                  <%
			If Len(rsClass("c_code"))>4 Then Response.Write "├"
			Response.Write String(Level,"-")
			%>
                  <a href="?class=<%=rsClass("id")%>&classname=<%=trim(rsClass("c_name"))%>" class="aBlack"><%=trim(rsClass("c_name"))%></a> 
                </td>
              </tr>
            </table></td>
          </tr>
          <tr> 
            <td height="1" background="images/line_1.gif"></td>
          </tr>
                                <%
									rsClass.movenext
								next
								%>
        <tr> 
          <td height="15">&nbsp;</td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="3">
        <tr> 
          <td height="31" bgcolor="#F5DCEC"> 
            <div align="center"><b><font size="2" class="fs-14px" color="#910000">新闻搜索</font></b></div>
          </td>
        </tr>
      </table>
      <table width="95%" border="0" cellpadding="12" cellspacing="0" align="center">
        <tr> 
          <td  valign="top"><form name="form1" method="post" action="?">
              <table width="100%" border="0" cellpadding="7" cellspacing="0">
                <tr> 
                  <td height="53" colspan="2"> 关键字: 
                    <input name="key" type="text" id="key2"> </td>
                </tr>
                <tr> 
                  <td height="3" valign="top" width="56%"> <div align="center"> 
                      <input name="imageField2" type="image" src="images/search.gif" width="53" height="19" border="0">
                    </div></td>
                  <td height="3" valign="top" width="44%">搜索帮助</td>
                </tr>
              </table>
            </form></td>
        </tr>
      </table>
      <!--Link Begin-->
      <%
							isLink=GetKey("Enable",WebUserID,"link")
							if isLink="Yes" then
							%>
      <table width="100%" border="0" cellpadding="0" cellspacing="3">
        <tr> 
          <td height="31" bgcolor="#F5DCEC"> 
            <div align="center"><b><font size="2" class="fs-14px" color="#910000">友情链接</font></b></div>
          </td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="7" cellspacing="0">
        <tr> 
          <td height="107"  valign="top"> 　 
            <div align="center">
              <script language="JavaScript" src="admin/link/link.asp"></script>
            </div>
          </td>
        </tr>
      </table>
      <%
							  end if
							  %>
      <!--Link End-->
    </td>
  </tr>
</table>
<table width="757" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
  <tr> 
    <td height="2" bgcolor="#FFFFFF"></td>
  </tr>
</table>
<table width="757" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td height="5" bgcolor="#CDCDCD"></td>
  </tr>
</table>
<table width="757" border="0" align="center" cellpadding="0" cellspacing="0" height="1">
  <tr> 
    <td></td>
  </tr>
</table>
<table width="757" border="0" cellspacing="0" cellpadding="10" align="center">
  <tr> 
    <td height="31" bgcolor="#FFFFFF"> 
      <div align="center"><font color="#666666">⑨footnote⑨<br>⑨ICP⑨<br>
        您是本站第<script language="JavaScript" src="admin/count/counter.asp"></script>位访问者</font></div>
    </td>
  </tr>
</table>
<script language="JavaScript" src="common/init.js"></script><br><script language=Javascript src="common/tranbig5.Js"></script>
</body>
</html>
