📄 wz.asp
字号:
<%@LANGUAGE="VBScript" codepage="936"%>
<!--#include file="conn.asp"-->
<!-- #include file="bh.asp" -->
<!-- #include file="ubbcode.asp" -->
<%
Function HTMLEncode(Str)
Str=Replace(Str," "," ")
Str=Replace(Str,Chr(10),"<br>")
HTMLEncode=Str
End Function
%>
<html>
<head>
<meta http-equiv="Page-Exit" content="revealTrans(Duration=1.0,Transition=12)">
<link href="skin_1.css" rel="stylesheet" type="text/css">
<STYLE type="text/css">
.re {
background-color: #FFFFFF;
margin: 4px;
padding: 4px;
border: 1px dotted #006699;
}
</STYLE>
<title>RanRan</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><img src="../Images/apperceive.jpg" alt="1" width="350" height="40" /></p>
<table width="310" border="0" cellpadding="0">
<tr>
<td height="15" align=right> <a target="blog" href="wz.asp?type=all">全部</a> ┊ <a target="blog" href="wz.asp?type=情感">情感</a> ┊ <a target="blog" href="wz.asp?type=搞笑">搞笑</a> ┊ <a target="blog" href="wz.asp?type=心得">心得</a> ┊ <a target="blog" href="wz.asp?type=日记">日记</a>
</td>
</tr>
</table>
<table width="560" border="0" cellpadding="1" cellspacing="0">
<tr>
<td height="12"></td>
</tr>
</table>
<%
dim rs
dim sql
msg_per_page = 8 '定义每页显示记录条数
set rs = server.createobject("adodb.recordset")
fenlei=Request.QueryString("type")
select CASE fenlei
CASE "情感"
sql ="select * from [wz] where fenlei='情感' order by id desc"
CASE "搞笑"
sql ="select * from [wz] where fenlei='搞笑' order by id desc"
CASE "心得"
sql ="select * from [wz] where fenlei='心得' order by id desc"
CASE "日记"
sql ="select * from [wz] where fenlei='日记' order by id desc"
CASE ELSE
sql ="select * from [wz] order by id desc"
end select 'RanRan
rs.cursorlocation = 3 '使用客户端游标,可以使效率提高
rs.pagesize = msg_per_page 'http://www.21wan.cn
rs.open sql,conn,0,1
if err.number<>0 then '错误处理
response.write "数据库操作失败:" & err.description
err.clear
else
if not (rs.eof and rs.bof) then '检测记录集是否为空
totalrec = RS.RecordCount 'totalrec:总记录条数
if rs.recordcount mod msg_per_page = 0 then '计算总页数,recordcount:数据的总记录数
n = rs.recordcount\msg_per_page 'n:总页数
else
n = rs.recordcount\msg_per_page+1
end if
currentpage = request("page") 'http://www.21wan.cn
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 'absolutepage:设置指针指向某页开头 QQ:1019257
rowcount = rs.pagesize 'pagesize:设置每一页的数据记录数
dim i
dim k
%>
<%do while not rs.eof and rowcount > 0%>
<table width="580" border="0" cellspacing="0" cellpadding="10">
<tr>
<td class="xndyk"><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr bgcolor="#F2F2F2">
<td width="78%"><img src="../Images/icon_2.gif" alt="1" width="15" height="10" align="absmiddle" /> <a href="wz1.asp?id=<%=rs("id")%>" title="阅读全文 <%=rs("title")%> 浏览:<%=rs("renqi")%> 整理日期:<%=rs("data")%>"><%=rs("fenlei")%> - <%=UBBCode(Left(rs("title"),15))%></a></td>
<td width="22%">
<div align="right"><font color=#999999>添加人:<%=rs("user")%></font></div></td>
</tr>
<tr>
<td colspan="2" height="1" background="images/heng-dian.gif"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="2">
<%if len(rs("text"))>94 then%>
<%=UBBCode(Left(rs("text"),94))%><a href="wz1.asp?id=<%=rs("id")%>">……</a>
<%else%>
<%=UBBCode(Left(rs("text"),94))%>
<%end if%>
</td>
</tr>
<tr>
<td colspan="2" height="1" background="images/heng-dian.gif"></td>
</tr>
<tr>
<td><font color="#666666"><%=rs("data")%></font></td>
<td><div align="right"><font color=#666666>浏览:<%=rs("renqi")%></font></div></td>
</tr>
</table></td>
</tr>
</table>
<table width="560" border="0" cellspacing="0" cellpadding="1">
<tr>
<td height="15"></td>
</tr>
</table>
<%
rowcount=rowcount-1
rs.MoveNext
loop
end if
end if
rs.close
set rs=nothing
%>
</table>
<table border="0" align=right>
<tr>
<td valign="middle" align=right>
<%call listPages()%>
</td>
</tr>
</table>
</body>
</html>
<%
sub listPages()
'if n <= 1 then exit sub
for i=0 to n\msg_per_page-1
for j=1 to msg_per_page
%>
<font size="2" color="#006600">
<a href="<%=request.ServerVariables("script_name")%>?page=<%=i*msg_per_page+j %>">
[<% =i*msg_per_page+j %>]</a></b></font>
<%
next
next
EndPage = n mod msg_per_page
for j=1 to EndPage
%>
<font size="2" color="#006600">
<a href="<%=request.ServerVariables("script_name")%>?page=<% =i*msg_per_page+j %>">
<%if (i*msg_per_page+j)=currentpage then%><b><%else%><%end if%>[<% =i*msg_per_page+j %>]</b></a></font>
<%next%>
<font color=black face="arial" >
<br>当前页:<font color=#FF000000><%=currentpage%>/<%=n%></font> 文章总数:<font color=#FF000000><%=totalrec%></font> 条
</font>每页显示:<font color=#FF000000>10</font><font color=black face="arial" > </font>条
<%end sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -