<!------新闻开始------>

<table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td>
                        <% 
'##############################################
'更多新闻连接，如果是所有的新闻，不用指定newstype的参数，newstype得参数值可在后台管理的新闻类别管理里查看
'news_language=0表示是中文的新闻，news_language=1表示是英文的新闻
'##############################################

newstype=trim(replace(request("newstype"),"'",""))
if newstype="" then
 sql="select news.news_id,news_title,news_date,news_type,news_content from news,news_class where news.news_class_id=news_class.news_id and news_language=0 order by news_date DESC"  
else
 sql="select news.news_id,news_title,news_date,news_type,news_content from news,news_class where news.news_class_id=news_class.news_id and news_language=0 "
 sql=sql & " and news_type = '"&newstype&"' order by news_date DESC"	  
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
 %>
                        <%
if Not rs.EOF then
dim newsperpage
newsperpage=20 '每页显现6条新闻
rs.movefirst
rs.pagesize=newsperpage
if trim(request("page"))<>"" then
   page1=trim(request("page"))
       currentpage=clng(request("page"))
       if currentpage>rs.pagecount then
          currentpage=rs.pagecount
       End if
else
   currentpage=1
End if
   totalnews=rs.recordcount
   if currentpage<>1 then
       if (currentpage-1)*newsperpage<totalnews then
	       rs.move(currentpage-1)*newsperpage
		   dim bookmark
		   bookmark=rs.bookmark
	   End if
   End if
   if (totalnews mod newsperpage)=0 then
      totalpages=totalnews\newsperpage
   else
      totalpages=totalnews\newsperpage+1
   End if
i=0
Do While Not rs.EOF and i<newsperpage
%>
                    <tr>
                      <td  height=30>· <a href="ShowNews.asp?news_id=<%=rs("news_id")%>"> <%=left(rs("news_title"),30)%></a></td>
                    </tr>
                    <%
i=i+1
rs.movenext
loop
else
if rs.EOF and rs.BOF then
%>
                    <tr>
                      <td height="22" align="center" colspan="2">当前没有新闻！</td>
                    </tr>
                    <%End if
End if
'开始分页
if Not request("type")=1 then%>
                    <form name="form1" method="post" action="Demo_newsmore.asp">
                      <tr align="center">
                        <td height="15" colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                      </tr>
                      <tr align="center">
                        <td height="30" colspan="2">&nbsp;共 <font  class=69><%=totalnews%></font> 个新闻　分<font class=69> <%=totalpages%> </font>页
                            <%
if CurrentPage<2 then
response.write "<font color='000000'>首页 上一页</font> "
else
response.write "<a href=?page=1&newstype="&request("newstype")&">首页</a> "
response.write "<a href=?page="&CurrentPage-1&"&newstype="&request("newstype")&">上一页</a> "
End if
if totalpages-currentpage<1 then
response.write "<font color='000000'>下一页 尾页</font>"
else
response.write "<a href=?page="&CurrentPage+1&"&newstype="&request("newstype")
response.write ">下一页</a> <a href=?page="&totalpages&"&newstype="&request("newstype")&">尾页</a>"
End if
end if
%>
&nbsp;
                          <select name="page" class="lanyu">
                            <%      
i=1
for i=1 to totalpages
if i=currentpage then
%>
                            <option value=<%=i%> selected>第<%=i%>页</option>
                            <%else%>
                            <option value=<%=i%>>第<%=i%>页</option>
                            <%
										  End if
next  
 %>
                          </select>
                          <input type="submit" name="Submit2" value="转向" class="button">
                          <input type="hidden" name="newstype" value="<%=newstype%>"></td>
                      </tr>
                    </form>
               
              <%
set rs=server.createobject("ADODB.Recordset")
sql="select * from P_info where p_other = 0 "
classType = request("classType")
smallclass = request("smallclass")
key = request("key")
if classType <> "" then
	sql = sql & " and p_type = '"&classType&"'"
end if
if smallclass <> "" then
	sql = sql & " and p_small_type = '"&smallclass&"'"
end if
if key <> "" then
	sql = sql & " and p_name like '%"&key&"%'"
end if

sql = sql & " order by p_id desc"
rs.open sql,conn,1,1

if not isempty(request("page")) then   
pagecount=cint(request("page"))   
else   
pagecount=1
end if

%>
              <%
rs.close
set rs=nothing
%>
          </td>
        </tr>
      </table>

<!------新闻结束------>
        