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

📄 boardlist.asp

📁 不错的ASP整站源代码。在IIS环境下运行都没有问题
💻 ASP
字号:
<!--#include file="security.asp"-->
<%
   if not isempty(request("page")) then
       currentPage=cint(request("page"))
   else
       currentPage=1
   end if
   MaxPerPage=6

%> 
<!--#include file=conn.asp -->
<html>
<head>
<link rel="stylesheet" href="../inc/style.css">
</head>
<body>
<center>
<%
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from callboard order by id desc"
rs.open sql,conn,1,1
  if rs.eof and rs.bof then
       response.write "<p align='center'>此交友系统还没有公告呢!</p>"
  else
	  totalPut=rs.recordcount
          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
            showhead totalput,MaxPerPage,"boardlist.asp"
            showContent
            showpage totalput,MaxPerPage,"boardlist.asp"
      else
          if (currentPage-1)*MaxPerPage<totalPut then
            rs.move  (currentPage-1)*MaxPerPage
            dim bookmark
            bookmark=rs.bookmark
            showhead totalput,MaxPerPage,"boardlist.asp"
            showContent
            showpage totalput,MaxPerPage,"boardlist.asp"
          else
	    currentPage=1
	    showhead totalput,MaxPerPage,"boardlist.asp"     
            showContent
            showpage totalput,MaxPerPage,"boardlist.asp"
	  end if
      end if
   rs.close
   end if
	        
   set rs=nothing  
   conn.close
   set conn=nothing
   
   
   

sub showContent
	dim i
	i=0

%> 

          <%do while not rs.eof%>

         <table width="100%" border="1" cellpadding="2" bgcolor="#FFFFFF" cellspacing="2" bordercolor="#FFFFFF">
          <tr> 
            <td bordercolorlight="#E32D3F" bordercolordark="#E32D3F"> 
              <table width="100%" border="0" cellspacing="3" cellpadding="0">
                <tr> 
                  <td colspan="2"><%=Rs("board")%></td>
                </tr>
                <tr bgcolor="#FFECEC"> 
                  <td height="1" colspan="2"></td>
                </tr>
                <tr> 
                  <td width="50%"><font color="#999999">发布人:<a href="adminread.asp?user_id=<%=Rs("user_id")%>"><%=Rs("name")%></a></font></td>
                  <td width="50%" align="right">
                   <font color="#999999">发布时间:<%=Rs("date")%></font>
                    <a href="delboard.asp?id=<%=Rs("id")%>">删除</a>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
        <br>

          <% i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	   loop%> 

    <%
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
  response.write "<table border=0 cellspacing=0 width=100% cellpadding=0><form method=Post action="&filename&"?typeid="&typeid&"><tr><td>"
    if CurrentPage<2 then
    response.write "<font color='#000000'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?page=1&typeid="&typeid&"&user_id="&request("user_id")&">首页</a>&nbsp;"
    response.write "<a href="&filename&"?page="&CurrentPage-1&"&typeid="&typeid&"&user_id="&request("user_id")&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font color='#000000'>下一页 尾页</font>"
  else
    response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&typeid="&typeid&"&user_id="&request("user_id")&">"
    response.write "下一页</a> <a href="&filename&"?page="&n&"&typeid="&typeid&"&user_id="&request("user_id")&">尾页</a>"
  end if
   response.write "</td><td align=right><font color='#000000'>&nbsp;页次: </font><b><font color=red>"&CurrentPage&"</font></b><font color='#000000'> / <b>"&n&"</b> 页</font>"
   response.write " <font color='#000000'>转到: <input type='text' name='page' size=3 maxlength=6 class=put value="&currentpage&"> 页</font>"
   response.write "</td></tr></form></table>"
       
end function

function showhead(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
  response.write "<table border=0 cellspacing=0 width=100% cellpadding=0><tr><td>共有 <font color='#ff0000'><b>"&totalnumber&"</b></font> 篇公告</td><td align=right>"
  if CurrentPage<2 then
	response.write "<font color='#000000'>上一页</font>&nbsp;"
  else
	response.write "<a href="&filename&"?page="&CurrentPage-1&"&typeid="&typeid&"&user_id="&request("user_id")&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
	response.write "<font color='#000000'>下一页</font>"
  else
	response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&typeid="&typeid&"&user_id="&request("user_id")&">下一页</a>"
  end if
	response.write "</td></tr></table>"
       
end function
%> 
</body>
</html>

⌨️ 快捷键说明

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