📄 allnews.asp
字号:
<!--#include file="conn_new.asp"-->
<!--#include file="const_new.asp"-->
<%
dim rs,sql
dim classid
dim classname
dim totalPut
dim CurrentPage
dim TotalPages
call getConst()
if request("classid")<>"" then
classid=request("classid")
else
classid=1
end if
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
set rs = server.createobject("adodb.recordset")
set rs1=server.createobject("adodb.recordset")
if trim(request("Nclassid"))<>"" then
Nclassid=trim(request("Nclassid"))
sql="select * from ANclass where NclassID="&cstr(Nclassid)
rs.open sql,conn,1,1
if not rs.eof then
Nclassname=rs("Nclass")
end if
rs.close
else
Nclassid=""
Nclassname="全部公告"
end if
sql="select * from Aclass where classID="&cstr(classid)
rs.open sql,conn,1,1
if not rs.eof then
classname=rs("class")
end if
rs.close
%>
<html>
<head>
<meta name="keywords" content="<%=NetName%>,<%=NetUrl%>">
<LINK href="../styles/style.css" rel=stylesheet>
<title>风格写手 公告</title>
<style TYPE="text/css">
<!--
A:link{text-decoration:none}
A:visited{text-decoration:none}
A:hover {color: #ff00ff;text-decoration:underline}
-->
</style>
<style type="text/css">
<!--
body {font-size:9pt}
td {font-size:9pt}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
<table width="755" border="0" cellpadding="0" align="center" border-width: 1" cellspacing="1" bgcolor="#999999">
<tr>
<td bgcolor="#FFFFFF" height=20 align=left width="560">
<table width="754" border="0" cellspacing="0" cellpadding="4">
<tr>
<td background="image/line01.gif" width="753"><img src="image/A3.gif" width="12" height="12">您的位置:<a href="http://www.70age.net/xieshou">首页</a>->
<a href="#">站务公告</a>-> <b>全部公告</b> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="<%=Tablebackcolor%>">
<%
if Nclassid<>"" then
sql="SELECT top 100 [article].[articleid], [article].[title], [article].[dateandtime], [article].[hits],[writer], [article].[classid], [article].[Nclassid], [ANclass].[Nclass] FROM ANclass INNER JOIN article ON [ANclass].[Nclassid]=[article].[Nclassid] where article.classid = " & Classid & " ORDER BY [article].[articleid] DESC"
else
sql="SELECT top 100 [article].[articleid], [article].[title], [article].[dateandtime], [article].[hits],[writer], [article].[classid], [article].[Nclassid], [ANclass].[Nclass] FROM ANclass INNER JOIN article ON [ANclass].[Nclassid]=[article].[Nclassid] WHERE [article].[Nclassid]=[ANclass].[Nclassid] ORDER BY [article].[articleid] DESC"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>没有或没有找到任何公告</p>"
else
MaxPerPage=PageCount
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,"allnews.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
showContent
showpage totalput,MaxPerPage,"allnews.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"allnews.asp"
end if
end if
rs.close
end if
sub showContent
dim i
i=0
do while not rs.eof
%>
<img src="image/A3.gif"> <img src="<%=rs("writer")%>" alt="心情图标">
[<font color="#FF0000"><%=rs("Nclass")%></font>] <a href="skinnews.asp?id=<%=rs("articleid")%>" alt="<%=rs("title")%>"><%=rs("title")%></a>
<%=rs("dateandtime")%>│<font color="#FF0000"><%=rs("hits")%></font><br>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
end sub
%>
</td>
</tr>
</table>
<%
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=Post action="&filename&">"
response.write ""&Nclassname&""
if CurrentPage<2 then
response.write ""&totalnumber&"个 首 页 上一页 "
else
response.write ""&totalnumber&"个 <a href="&filename&"?page=1>首 页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write "下一页 末 页"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
response.write "下一页</a> <a href="&filename&"?page="&n&">末 页</a>"
end if
response.write " 页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
response.write " <b>"&maxperpage&"</b>条公告/页 "
%>
<%
end function
set rs=nothing
conn.close
set conn=nothing
%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -