详细说明:
<%=webname%>--新闻快讯 <% Dim Intcatid,strOrder,strcat,strcategory Intcatid = 0 Intcatid=SafeRequest("catid",1) strcat = "综合新闻" set rs=server.CreateObject("adodb.recordset") If Intcatid <> 0 Then rs.open " select category from category where categoryid="&Intcatid&" ",conn,1,1 strcategory = trim(rs("category")) rs.close strcat = strcat &"->"& strcategory &" " Else End If %> <% Const MaxPerPage=20 dim totalPut dim CurrentPage dim TotalPages dim j dim sql if Not isempty(SafeRequest("page",1)) then currentPage=Cint(SafeRequest("page",1)) else currentPage=1 end if If Intcatid = 0 Then rs.open "select newsid,newsname,newscontent,addname,adddate from news Order By adddate desc",conn,1,1 Else rs.open "select newsid,newsname,newscontent,addname,adddate from news Where categoryid = "& Intcatid &" Order By adddate desc ",conn,1,1 End If if rs.eof And rs.bof then Response.Write " 您还没有添加新闻!
" else totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showContent showpage totalput,MaxPerPage,"chknews.asp" else if (currentPage-1)*MaxPerPage
background="<% = webimg16 %>"> >新闻主题 | >发布人 | >发布时间 |
<%do while not rs.eof%> ','','width=500,height=300,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"> ><%=trim(rs("newsname"))%> | ><%=trim(rs("addname"))%> | ><%=rs("adddate")%> |
<%i=i+1 if i>=MaxPerPage then Exit Do rs.movenext loop rs.close set rs=nothing%><% End Sub Function showpage(totalnumber,maxperpage,filename) Dim n If totalnumber Mod maxperpage=0 Then n= totalnumber \ maxperpage Else n= totalnumber \ maxperpage+1 End If %> <% End Function %> |
...展开收缩