<!--#include file="inc/Ft_conn.asp"-->
<!--#include file="inc/Ft_config.asp"-->
<!--#include file="inc/Ft_format.asp"-->
<!--#include file="inc/Ft_lib.asp"-->
<%
'==================================
'=文 件 名：news.asp
'=适用版本：FeitecCMS AC V3.0 Free
'=功    能：新闻列表
'=作    者：雨城 & 太阳光 [From to FeitecStudio]
'=日    期：2008-09-13 22:13
'=版    权：http://www.feitec.com/
'=Free官方：http://demo.feitec.com/
'=免费支持：http://bbs.feitec.com/
'=收费版本：http://www.feitec.com/ProInfo.asp
'=免费资源：http://www.40t.cn
'=虚拟主机：http://vip.40t.cn
'==================================
StartTime
sub_title="新闻"
Ft_mbstr=head()
StrTemp=Split(mb_news,"|||@@@|||")
Ft_mbstr=Ft_mbstr+Replace(StrTemp(0),"{left_pub}",m_leftpub)
Ft_mbstr=Ft_mbstr+foot()
Call PubFunction(Ft_mbstr)
Dim totalnews,Currentpage,totalpages,catid,cattotal,curpagenum
'设置新闻系统为默认分页大小的倍率
curpagenum=pagenum
If Request.QueryString("page")<>"" Then page=cint(CheckSql("新闻分页",Request.QueryString("page"),0,8))
If Request.QueryString("cat_id")<>"" Then
	catid=CheckSql("新闻分类",Request.QueryString("cat_id"),0,4)
	Sql="Select cat_id From [Ft_news_cat] Where cat_id="&catid
	Set Rs=Server.Createobject("adodb.recordset")
	Rs.open Sql,Conn,1,1
	If Rs.Eof Then Response.Redirect("showerr.asp?errmsg=<br><li>没有此分类或该分类已删除！</li>")
	Rs.Close:Set Rs=Nothing
	Sql="Select * From [Ft_news] Where cat_id="&catid&" Order By istop=1,News_id Desc"
Else
	Sql="Select * From [Ft_news] Order By istop=1,News_id Desc"
End If
Set Rs=Server.Createobject("adodb.recordset")
Rs.open Sql,Conn,1,1
If Request.QueryString("cat_id")<>"" Then
	catname=""
	Sql="Select cat_name From [Ft_news_cat] Where cat_id="&catid
	Set Rscat=Server.Createobject("adodb.recordset")
	Rscat.open Sql,Conn,1,1
	catname=Rscat(0)
	Rscat.Close:Set Rscat=Nothing
	cattotal="<span class=""key_font"">【"&catname&"】</span>分类共有 <span class=""key_font"">"&Rs.RecordCount&"</span> 条新闻&nbsp;"
Else
	cattotal="目前本站共有 <span class=""key_font"">"&Rs.RecordCount&"</span> 条新闻&nbsp;"
End If
Ft_mbstr=Replace(Ft_mbstr,"$cattotal$",cattotal)
Dim Ft_mbstr_newslist,newsstate,newsnew
Ft_mbstr_newslist=split(Ft_mbstr,"///")
Response.Write Ft_mbstr_newslist(0)
If Not Rs.Eof Then
	i=0
	Rs.PageSize=pagenum
	If Trim(Request.QueryString("page"))<>"" Then
	  page=cint(Request.QueryString("page"))
	  If page>Rs.PageCount Then page=Rs.PageCount
	Else
	  page=1
	End If
	Rs.AbsolutePage=page
	Do While Not Rs.Eof And i<Rs.PageSize
		If Rs("istop")=1 Then
			newsstate="<a href='shownews.asp?id="&Rs("news_id")&"' target='_blank'><img src='"&signimgpath&"/ztop.gif' border='0' alt='置顶新闻'></a>"
		ElseIf Rs("user_view")=1 then
			newsstate="<a href='shownews.asp?id="&Rs("news_id")&"' target='_blank'><img src='"&signimgpath&"/userview.gif' border='0' alt='会员新闻，此条需消费"&Rs("moneypay")&"个金币'></a>"
		ElseIf Rs("user_view")=2 then
			newsstate="<a href='shownews.asp?id="&Rs("news_id")&"' target='_blank'><img src='"&signimgpath&"/vipview.gif' border='0' alt='VIP会员新闻，此条需消费"&Rs("moneypay")&"个金币'></a>"
		Else
			newsstate="<a href='shownews.asp?id="&Rs("news_id")&"' target='_blank'><img src='"&signimgpath&"/normal.gif' border='0' alt='普通新闻'></a>"
		End if
		newsnew=""
		If DateDiff("d",Rs("news_date"),Now())<CInt(newtime) Then newsnew="<img src='"&signimgpath&"/new.gif' border='0'>"
		Ft_mbstr=Replace( Ft_mbstr_newslist(1),"$newsstate$",newsstate)
		Ft_mbstr=Replace(Ft_mbstr,"$newsid$",Rs("news_id"))
		Ft_mbstr=Replace(Ft_mbstr,"$newstitle$",Rs("news_title"))
		Ft_mbstr=Replace(Ft_mbstr,"$newsnew$",newsnew)
		Ft_mbstr=Replace(Ft_mbstr,"$newsdate$",Rs("news_date"))
		Ft_mbstr=Replace(Ft_mbstr,"$newscount$",Rs("news_count"))
		Response.Write Ft_mbstr
		i=i+1
		Rs.MoveNext
	Loop
Else
	Response.Write"<tr class=""tablebody""><td colspan=""4"" height=""70"" align=""center"" class=""disable_font"">暂时没有此分类或此类新闻！</td></tr>"
End If
totalnews=Rs.RecordCount '总数据
totalpages=Rs.PageCount '总页数
Rs.Close:Set Rs=Nothing
Response.Write Ft_mbstr_newslist(2)
If totalpages>1 Then
	Ft_mbstr=Replace(Ft_mbstr_newslist(3),"$newspage$",showpage(totalnews,totalpages,page,"news.asp?"))
Else
	Ft_mbstr=Replace(Ft_mbstr_newslist(3),"$newspage$","")
End If
Ft_mbstr=Replace(Ft_mbstr,"$runtime$",EndTime)
Response.Write Ft_mbstr
CloseDatabase%>