<% Dim newsYear,Cid,Sql,channel,Cids newsYear = Request.QueryString("year") Cid = Request.QueryString("cid") if Not IsNumeric(newsYear) and not isEmpty(newsYear) then response.Redirect("news.asp") end if if Not IsNumeric(Cid) and not isEmpty(Cid) then response.Redirect("news.asp") end if if not IsEmpty(newsYear) and not IsEmpty(Cid) then 'select [ID],[CID],[Title],[Description],[IndexPic],[CreateTime] from [{pre}content] where [FatherID] in (3,4,5,6,7,8) order by [CreateTime] Desc limit "&offset&" , "&newsPageList,1) Set channel = DB(" select [CID] from [{pre}channel] where [FatherID]="&Cid&" and [Name]='"&newsYear&"'",1) elseif not IsEmpty(newsYear) then Set channel = DB(" select [CID] from [{pre}channel] where [Name]='"&newsYear&"'",1) Elseif not IsEmpty(Cid) then Set channel = DB(" select [CID] from [{pre}channel] where [FatherID]="&Cid,1) Else response.Redirect("news.asp") end if if not channel.eof then do while not channel.eof if isEmpty(Cids) then Cids=channel("CID") Else Cids=Cids&","&channel("CID") End IF channel.moveNext loop end if if isEmpty(Cids) then Cids="10000000" end if %> 2007-上海良时
logo 认证 高新企业
Since 1993 股票代码:837430厚积薄发  持续创新

市场咨询:021-51035200

应急服务:18602123305 / 18918186798

7×24小时服务热线:400-021-5767

200711122
    <% Dim channelList,ClassStr Set channelList = DB("Select [NAME] From [{pre}channel] Where [FatherID] in (3,4,5,6,7,8) GROUP BY [NAME] Order By [NAME] desc ", 1) ' 获取内容 if not channelList.eof then do while not channelList.eof if channelList("name")=newsYear then ClassStr="active" else ClassStr="" end if %>
  • &Cid=<%=Cid%>"><%=channelList("NAME")%>年新闻
  • <% channelList.movenext loop end if %>
<% Function Ceil(num) If num = Int(num) Then Ceil = num Else Ceil = Int(num) + 1 End If End Function '新闻列表分页 DIM News, newsPage, newsPageList, offset, totalRecords, totalPages,rsCount newsPageList = 6 ' 每页显示6条 ' 获取当前页码 newsPage = Trim(Request.QueryString("page")) If Len(newsPage) = 0 Or IsNull(newsPage) Or Not IsNumeric(newsPage) Then newsPage = 1 Else newsPage = CLng(newsPage) If newsPage < 1 Then newsPage = 1 End If offset = (newsPage - 1) * newsPageList ' 获取总记录数 Set rsCount = DB("SELECT COUNT(*) AS Total FROM [{pre}content] WHERE [CID] IN ("&Cids&")", 1) totalRecords = rsCount("Total") rsCount.Close Set rsCount = Nothing totalRecords = CLng(totalRecords) ' 转换为长整型 ' 计算总页数 totalPages = Ceil(totalRecords / newsPageList) ' 如果页码超出总页数,修正 If newsPage > totalPages And totalPages > 0 Then newsPage = totalPages offset = (newsPage - 1) * newsPageList End If if newsPage=1 then Set News= DB("select top "&newsPageList&" [ID],[CID],[Title],[Description],[IndexPic],[CreateTime] ,[viewPath] from [{pre}content] where [Cid] in ("&Cids&") order by [CreateTime] ",1) else Set News= DB("select top "&newsPageList&" [ID],[CID],[Title],[Description],[IndexPic],[CreateTime] ,[viewPath] from [{pre}content] where [Cid] in ("&Cids&") and [ID] not in( SELECT TOP "&offset&" [ID] FROM [{pre}content] WHERE [Cid] in ("&Cids&") order by [CreateTime] Desc ) order by [CreateTime] Desc ",1) end if Do while not News.eof %>

<%=News("Title")%>

<%=News("CreateTime")%>

<%=News("Description")%>

" class="nx-more">查看详情
<% News.moveNext Loop %>
共<%=totalRecords%>条 <% If totalRecords > 0 Then %> <% If newsPage > 1 Then %> 上一页 <% End If %> <% ' 显示页码(当前页前后各显示2页) Dim startPage, endPage, p startPage = newsPage - 2 If startPage < 1 Then startPage = 1 endPage = newsPage + 2 If endPage > totalPages Then endPage = totalPages For p = startPage To endPage If p = newsPage Then Response.Write "" & p & "" Else Response.Write "" & p & "" End If Next %> <% If newsPage < totalPages Then %> 下一页 末页 <% End If %> <% end if %>