<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/config_list.asp"-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>新闻分类</title>
<LINK href="../images/home.css" type=text/css rel=stylesheet>

<script src="../jquery/jquery-1.3.2.src.js" language="javascript"></script>
</head>
<%
filename="index.asp"
newsClassID_request=request.QueryString("id")
'-------------------------------------分页各参数
	if request("page")<>"" then
	pageNo = Clng(Request("page"))'int最大值只有到32767. 
	else
	pageNo = 1
	end if
	PageSize = 35

'------------------------------全局变量定义	
		 	set rs=server.createobject("adodb.recordset")

%>
<body>

<!--顶部开始-->
<!--#include file="../mb/topNews_mb.asp"-->
<!--顶部结束-->

<div style="width:960px; margin:0 auto; "><script language="javascript" src="/otherhtml/newsClass_1.js"></script></div>

<div style="width:960px; margin:0 auto; ">

 <!--左开始-->
  <div style="width:250px; float:left; "  class="ulli">
    <div  style="border:#56B3EF 1px solid; float:left; width:248px;">
      <H3><SPAN class=Name>推荐新闻</SPAN></H3>
      <ul>
      <%
	  
	   sql="SELECT TOP 10 * FROM News where isgood<>0 ORDER BY newsid desc "
	   
     	 'sql="SELECT TOP 10 * FROM News ORDER BY NEWID() "
'		 if sqlconn=0 then
'		 		 sql="SELECT TOP 10 * FROM News where isgood =true ORDER BY newsid desc "
'
'		 else
'		 		 sql="SELECT TOP 10 * FROM News where isgood =1 ORDER BY newsid desc "
'
'		 end if
'		 
         rs.open sql,conn,1,1
		Do While not rs.eof
				newsID=rs("newsID")
				newsTitle=rs("newsTitle")
				hits=rs("hits")
				adddate=rs("adddate")
   		 %>
        <li><a href="<%=urlNews(newsID)%>" title="<%=newsTitle%>"><%=newsTitle%></a></li>
        <%
		Rs.Movenext
		Loop
		rs.close
		%>
      </ul>
    </div>
    
	  <div style=" text-align:center;">
	<script language="javascript" src="/otherhtml/newsClass_2.js"></script></div>
    
	  <div style="width:248px;float:left; margin-top:5px; border:#56B3EF 1px solid; text-align:left;"  class="ulli">
      <H3><SPAN class=Name>最热新闻</SPAN></H3>
      <ul>
       <%
     	 sql="SELECT top 20 [newsID],news.[newsClassID],[userID],[newsTitle],[newsContent],[newsPic],[isComment],[isActive],news.[addDate],[hits],[isgood],newsclassname FROM [News] LEFT JOIN NewsClass on NewsClass.newsClassID=news.newsClassID ORDER BY hits desc"
         rs.open sql,conn,1,1
		Do While not rs.eof
				newsID=rs("newsID")
				newsTitle=rs("newsTitle")
				hits=rs("hits")
				adddate=rs("adddate")
				newsclassname=rs("newsclassname")

   		 %>
        <li><a href="<%=urlNews(newsID)%>" title="<%=newsTitle%>"><span class="more"><%=rs("hits")%></span>[<%=rs("newsclassname")%>]<%=newsTitle%></a></li>
        <%
		Rs.Movenext
		Loop
		rs.close
		%>

      </ul>
    </div>
  </div>
  <!--左结束-->
  
   <!--右开始-->
  <div style="width:700px; float:left; margin-left:8px; border:#56B3EF 1px solid;" >

  <DIV  style="text-align:left;" class="ulli">
        <H3><SPAN class=Name>当前位置:<a href="/">首页</a>--<a href="/news/index.asp">新闻文章</a></SPAN></H3>

 		 <ul>
         <%

		 if newsClassID_request<>"" then
		 	requestStr="newsClassid="&newsClassID_request
		 end if
		 strWhere=""
		 if newsClassID_request<>"" then
		 	strWhere=" where news.newsClassid="&newsClassID_request
		 end if
sql="SELECT [newsID],news.[newsClassID],[userID],[newsTitle],[newsContent],[newsPic],[isComment],[isActive],news.[addDate],[hits],[isgood],newsclassname FROM [News] LEFT JOIN NewsClass on NewsClass.newsClassID=news.newsClassID "&strWhere&" ORDER BY newsID desc"
         rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		response.Write("暂无信息")
	else
	
	rs.pagesize=pagesize
	rs.absolutePage=pageNo
	totalnumber=rs.recordcount
	
	count=0
	Do While not Rs.Eof And Count<Rs.PageSize
		newsID=rs("newsID")

	newsTitle=rs("newsTitle")
	hits=rs("hits")
	adddate=rs("adddate")
    %>
         	<li><span class="more"><%=adddate%></span><a href="<%=urlNews(newsID)%>" title="<%=newsTitle%>-<%=hits%>">[<%=rs("newsclassname")%>]<%=newsTitle%></a></li>
            <%
Rs.Movenext
Count=Count+1
Loop
end if
rs.close
%>


         </ul>
        </DIV>
        <%showpage totalnumber,PageSize,fileName '调用分页函数%>

  </div><!--右结束-->
  <div  style=" clear:both"></div>
  </div>
  <div class="width960 margin_top5 textCenter"><script language="javascript" src="/otherhtml/newsClass_3.js"></script></div>

<%
'showpage RecordCount,PageSizeX,fileName '调用分页函数

'分页函数-----------------------------------------
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
	n= totalnumber \ maxperpage
else
	n= totalnumber \ maxperpage+1
end if
%>
<form method=Post action="<%=filename%>?<%=requestStr%>">
  <center>
  共<font color="#ff0000"><b><%=totalnumber%></b></font>条记录/每页<%=maxperpage%>条
  <%if pageNo<2 then%>
  &nbsp;首页 上一页&nbsp;
  <%else%>
  &nbsp<a href="<%=filename%>?page=1&<%=requestStr%>">首页</a>&nbsp; <a href="<%=filename%>?page=<%=pageNo-1%>&<%=requestStr%>">上一页</a>&nbsp;
  <%
end if
if n-pageNo<1 then
%>
  下一页 末页
  <%else%>
  <a href="<%=filename%>?page=<%=pageNo+1%>&<%=requestStr%>">下一页</a> <a href="<%=filename%>?page=<%=n%>&<%=requestStr%>">末页</a>
  <%end if%>
  &nbsp;页次:<strong><font color="#ff0000"><%=pageNo%>/<%=n%></font></strong>页
  转到:
<select name="page" size="1" onChange="javascript:submit()">
    <%for i = 1 to n%>
    <option value="<%=i%>" <%if cint(pageNo)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
    <%next%>
  </select>
</center>
</form>

<% 
end function
'分页函数结束-------------------------------------------
%>

<%set rs=nothing : set rs2=nothing : Conn.Close : set Conn=nothing
%>


<script type="text/javascript" src="/js/foot.js"></script>

</body>
</html>
<SCRIPT language="javascript" src="/Std_StranJF.Js"></SCRIPT>

