⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 news.asp

📁 发布整站源码 可以再开发~ 本人实用中 效果嗷嗷滴~
💻 ASP
字号:
<!--#include file="config.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="code.asp"-->
<%
if not isempty(request("page")) then
	currentPage=cint(request("page"))
else
	currentPage=1
end if
menu=htmlencode(request("menu"))
if menu="" or (not isnumeric(menu)) or isnull(menu) then
	menu="all"
end if
set rs = server.createobject("adodb.recordset")
%>
<HTML>
<HEAD>
<TITLE><%=webname%>|千年私服|天堂2私服|仿盛大私服|魔兽世界私服|RO私服|奇迹私服</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META content=私服发布程序,私服宣传,私服技术,千年私服,仿盛大私服,奇迹私服,天堂2私服,魔兽世界私服,A3私服 name=keywords>
<meta name="description" content="3316私服发布程序(系统)是一个简单、实用的免费私服信息发布程序">
<LINK href="image/css.css" type=text/css rel=stylesheet>
</HEAD>
<BODY leftMargin=0 background="<%=bgimage%>" topMargin=0>
<!--#include file="top.asp"-->
<!--#include file="ad.asp"-->
<table width="780"  border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#666666">
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;&nbsp;当前位置:<a href="index.asp">首页</a>&gt;&gt;最新公告</td>
  </tr>
</table>
<br>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="75%" valign="top"><table width="99%"  border="0" cellpadding="3" cellspacing="1" bgcolor="#000000">
      <tr>
        <td height="300" valign="top" bgcolor="#FFFFFF"><table width="98%"  border="0" align="center" cellpadding="2" cellspacing="0">
          <%
sql="select * from News order by addtime desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
	response.write "<tr><td colspan=3 align=center>当前没有公告!</td></tr>"
	rs.close
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,"news.asp" 
 		else 
 		if (currentPage-1)*MaxPerPage<totalPut then 
			rs.move  (currentPage-1)*MaxPerPage 
			showContent 
 			showpage totalput,MaxPerPage,"news.asp" 
  		else 
	  		currentPage=1 
  			showContent 
  			showpage totalput,MaxPerPage,"nes.asp" 
			end if 
		end if 
	rs.close 
	end if
	sub showContent 
 	dim i 
	i=0 
	%>
  <%do while not rs.eof%>
          <tr>
            <td width="5">·</td>
            <td><a href="news_display.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></td>
            <td width="60"><%if rs("addtime")<>"" then response.write month(rs("addtime"))&"月"&day(rs("addtime"))&"日 "%></td>
          </tr>
  <%
i=i+1
if i>=MaxPerPage then exit do
	rs.movenext 
loop
rs.close
end sub
%>
        </table></td>
      </tr>
    </table>

	</td>
    <td width="6"></td>
    <td valign="top"><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#000000">
        <tr>
          <td align="center" bgcolor="#FFFFFF"><img src="image/ad_none.gif" width="100" height="80"><br>
              <br>
              <img src="image/ad_none.gif" width="100" height="80"><br>
              <br>
              <img src="image/ad_none.gif" width="100" height="80"><br>
              <br>
              <img src="image/ad_none.gif" width="100" height="80"><br>
              <br>
              <img src="image/ad_none.gif" width="100" height="80"></td>
        </tr>
    </table></td>
  </tr>
</table>
<!--#include file="foot.asp"-->
</body>
</html>
<%
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 "<tr><form method=Post action="&filename&"?menu="&menu&"><td align=right colspan=3>"

  	if CurrentPage<2 then
 		response.write "共"&totalnumber&"条记录&nbsp;首页 上页&nbsp;"
  	else
 		response.write "共"&totalnumber&"条记录&nbsp;<a href="&filename&"?page=1&menu="&menu&">首页</a>&nbsp;"
 		response.write "<a href="&filename&"?page="&CurrentPage-1&"&menu="&menu&">上页</a>&nbsp;"
  	end if

  	if n-currentpage<1 then
 		response.write "下页 尾页"
  	else
 		response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&menu="&menu&">"
 		response.write "下页</a> <a href="&filename&"?page="&n&"&menu="&menu&">尾页</a>"
  	end if
	response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
 	response.write "&nbsp;<b>"&maxperpage&"</b>条记录/页 "
	response.write "转:<select name='page' size=1 onchange=javascript:submit()>"
	for i = 1 to n
		response.write "<option value="&i&" "
			if cint(Page)=cint(i) then
				response.wirte "selected "
			end if
		response.write ">第"&i&"页</option>"
	next
	response.write "</select></td></form></tr>"
end function
set rs=nothing
%>
<%
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -