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

📄 affiche.asp

📁 我见过的用ASP写的最好的留言簿程序
💻 ASP
字号:
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=urlname%> - 公告板</title>
</head>
<body>
<!--#include file="top.asp"-->
<%
sql="Select * from bulletin order by time desc"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
noninfo="尚无公告..."
non(noninfo)
else
%>
<table width="80%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="4%"><img src="images/skin/t-tl.gif" width="31" height="29"></td>
    <td width="91%" background="images/skin/t-tc.gif">&nbsp;</td>
    <td width="5%"><img src="images/skin/t-tr.gif" width="35" height="29"></td>
  </tr>
  <tr>
    <td background="images/skin/t-lt.gif">&nbsp;</td>
    <td><%
dim currentpage,page_count,Pcount
dim totalrec,endpage
if request("page")="" then
currentPage=1
else
currentPage=cint(request("page"))
end if
rs.PageSize = page
rs.AbsolutePage=currentpage
page_count=0
totalrec=rs.recordcount
while (not rs.eof) and (not page_count = rs.PageSize)
%>
        <table width="95%" height="50%" border="0" align="center" cellpadding="5" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse table-layout:fixed;word-break:break-all">
  <tr>
  <td height="25" colspan="3" bordercolor="#495474" style="border: 1px solid #495474; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" background="images/bg1.gif">
  <b>&nbsp;&nbsp;<font color="#990000">公告栏信息</font>
    &nbsp;</b>发表于:&nbsp;<font color="#FF3300"><%=rs("time")%></font></td>
  </tr>
    <tr>
  <td width="3%" style="border-left: 1px solid #495474; border-right-width: 1; border-top-width: 1; border-bottom-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" rowspan="2">&nbsp;&nbsp;</td>
  <td>
  </td>
  <td width="8%" style="border-right: 1px solid #495474" rowspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td width="480" onload="javascript:if(this.width>480)this.width=480">
	标题:<b><%= HTMLEncode(rs("title")) %></b><hr>
	</td>
  </tr>
  <tr>
  <td width="3%" style="border-left: 1px solid #495474; border-right-width: 1; border-top-width: 1; border-bottom-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" rowspan="2">&nbsp;&nbsp;</td>
  <td>
  </td>
  <td width="8%" style="border-right: 1px solid #495474" rowspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td width="620" background="images/t_dot.gif" onload="javascript:if(this.width>620)this.width=620" style="line-height: 210%">
	<%=change(rs("usercontent"))%>
	</td></tr>
  <tr>
  <td colspan="3" background="images/bg1.gif" style="border: 1px solid #495474; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1">&nbsp;<%if session(Variable&Names)=Variable then%>
  <a href="del_affiche.asp?id=<%=rs("id")%>">删除公告</a>
  <%end if%></td>
  </tr>
  </table>
      <p><%
page_count = page_count + 1
rs.movenext
wend
call pages()
rs.close
set rs=nothing

sub pages()
dim ii,p,n
if totalrec mod page=0 then
n= totalrec \ page
else
n= totalrec \ page+1
end if
if currentpage-1 mod 10=0 then
p=(currentpage-1) \ 10
else
p=(currentpage-1) \ 10
end if
response.write "<table border=0 cellpadding=0 cellspacing=3 width='80%' align=center ><form method=post action=index.asp>"&_
"<tr>"&_
"<td valign=middle align=center>页次:<font color='#FF3300'><b>"& currentPage &"</b>/<b>"& n &"</b></font>&nbsp;页,每页&nbsp;<font color='#FF3300'><b>"& rs.PageSize &"</b></font>&nbsp;条公告,共&nbsp;<font color='#FF3300'><b>"& totalrec &"</b></font>&nbsp;条公告<br><br>"

if currentPage=1 then
response.write "<font face=webdings>9</font>   "
else
response.write "<a href='?page=1'><font face=webdings>9</font></a>   "
end if
if p*10>0 then response.write "<a href='?page="&Cstr(p*10)&"'><font face=webdings>7</font></a>   "
response.write "<b>"
for ii=p*10+1 to P*10+10
if ii=currentPage then
response.write "<font size=4>"+Cstr(ii)+"</font> "
else
response.write "<a href='?page="&Cstr(ii)&"'>"+Cstr(ii)+"</a>   "
end if
if ii=n then exit for
'p=p+1
next
response.write "</b>"
if ii<n then response.write "<a href='?page="&Cstr(ii)&"'><font face=webdings>8</font></a>   "
if currentPage=n then
response.write "<font face=webdings>:</font>   "
else
response.write "<a href='?page="&Cstr(n)&"'><font face=webdings>:</font></a>   "
end if
response.write "</form></table>"
end sub
%></p>
    </td>
    <td background="images/skin/t-rt.gif">&nbsp;</td>
  </tr>
  <tr>
    <td><img src="images/skin/t-bl.gif" width="31" height="32"></td>
    <td background="images/skin/t-bc.gif">&nbsp;</td>
    <td><img src="images/skin/t-br.gif" width="35" height="32"></td>
  </tr>
</table><% end if %>
<!--#include file="bottom.asp"-->
</body>
</html> 

⌨️ 快捷键说明

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