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

📄 photo.asp

📁 提供给大家学习交流,图片制作程序.希望大家提出提意见.
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
dim rs
dim sql
msg_per_page = 20
set rs = server.createobject("adodb.recordset")
sql="select * from photo order by time DESC"
rs.cursorlocation = 3

rs.pagesize = msg_per_page
rs.open sql,conn,0,1 
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css.css" rel="stylesheet" type="text/css">
<title></title>
<style type="text/css">
<!--
.style3 {font-size: 1pt;
	color: #FFFFFF;
}
.ziti {font-family: "宋体";
	font-size: 12px;
	font-weight: bold;
	color: #FFFFFF;
}
.ziti1 {font-size: 12px;
	font-weight: normal;
	color: #000000;
}
.ziti2 {font-family: "宋体";
	font-size: 12px;
	font-weight: bold;
	color: #FFFFFF;
}
.ziti2 {	font-family: "宋体";
	font-size: 12px;
	font-weight: normal;
	color: #000000;
}
.ziti3 {
	font-family: "宋体";
	font-size: 14px;
	font-weight: normal;
	color: #000000;
}
-->
</style>
</head>

<body>
<table width="626" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="626" height="227" align="center" valign="top" class="style3"> 1 
      <table border="0" style="border-collapse: collapse" bordercolor="#FFFFFF" width="100%" id="AutoNumber1" bgcolor="#D0E8FF" cellspacing="1">
        <tr>
          <td><p align="left"> </td>
        </tr>
        <%
if err.number<>0 then 
response.write "数据库操作失败:" & err.description
err.clear
else
if not (rs.eof and rs.bof) then 
totalrec = RS.RecordCount 
if rs.recordcount mod msg_per_page = 0 then 
n = rs.recordcount\msg_per_page 
else 
n = rs.recordcount\msg_per_page+1 
end if 

currentpage = request("page") 
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage < 1 then 
currentpage = 1
end if 
if err.number <> 0 then 
err.clear
currentpage = 1
end if
else
currentpage = 1
End if 
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then 
currentPage=1
end if
rs.absolutepage = currentpage 
rowcount = rs.pagesize 
%>
        <%
dim r
dim j
dim k
r=0
 while not rs.eof and rowcount > 0
 if r mod 5=0 then
  row="<tr>"
 else
  row="&nbsp;"
 end if
 r=r+1
 response.write(row)
 response.write("<td width=100 class=ziti2 align=center>" & "<a target=_blank href=photoview.asp?id=" & rs("id") & "><img width=80 height=60 border=0 src=uploadimg/" & rs("url") & "></a><p>")
 response.write(rs("name") &"<br>")
 rowcount=rowcount-1
 rs.MoveNext
 wend
 end if
 end if
 rs.close
 set rs=nothing
 conn.close
 set conn=nothing
%>
      </table></td>
  </tr>
  <tr>
    <td height="20" class="ziti1">
    <table border="0" align="center">
<tr>
<td align="center" valign="middle" class="ziti1"> 
<%call listPages()%></td>
</tr>
</table>
    <span class="ziti1">
    <%
sub listPages() 
for i=0 to n\msg_per_page-1 
for j=1 to msg_per_page 
%> 
    <b>
    <a href="<%=request.ServerVariables("script_name")%>?page=<%=i*msg_per_page+j %>">
    <font color="#000000" class="ziti1">[
    <% =i*msg_per_page+j %>
    ]</font></a></b></font>&nbsp;&nbsp;
    <% 
next 
next
EndPage = n mod msg_per_page 
for j=1 to EndPage 
%> 
    <b>
    <a href="<%=request.ServerVariables("script_name")%>?page=<% =i*msg_per_page+j %>">
    <font color="#000000" class="ziti1">[
    <% =i*msg_per_page+j %>
    ]</font></a></b>
    <%next%>
    <br>
    <b>
    <font size="2" class="ziti1">当前页:<%=currentpage%>/<%=n%>总页数 &nbsp;&nbsp;<%=msg_per_page%>张照片/页 &nbsp;&nbsp;总照片数:<%=totalrec%>张</font></b><font size="2">
<%end sub%> 
    </font></span></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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