📄 index_diary.asp
字号:
<%sub index_diary()
dim totaldiary,Currentpage,totalpages,i
opendiary
sql="select * from diary order by d_date DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width="100%" border="0" cellspacing="0">
<tr>
<td height="8"></td>
</tr>
</table>
<table width="554" border="0" height=22 align="center" cellpadding="0" cellspacing="0">
<tr><td><img src=images/index_diary.jpg border=0 width=554></td></tr>
</table>
<table width="100%" border="0" cellspacing="0" align="center" cellpadding="0">
<%if not rs.eof then
rs.Movefirst
rs.pagesize=diaryperpage
if trim(request("page"))<>"" then
currentpage=clng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
totaldiary=rs.recordcount
if currentpage<>1 then
if(currentpage-1)*diaryperpage<totaldiary then
rs.move(currentpage-1)*diaryperpage
dim bookmark
bookmark=rs.bookmark
end if
end if
if (totaldiary mod diaryperpage)=0 then
totalpages=totaldiary\diaryperpage
else
totalpages=totaldiary\diaryperpage+1
end if
i=0
do while not rs.eof and i<diaryperpage
url="viewdia.asp?d_id="&rs("d_id")%>
<tr>
<td bgcolor="#FFFFFF" align="right">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td rowspan=2 background=images/index_diary_24.gif ><img src=images/index_diary_24.gif border=0></td>
<td width="184" rowspan="2" align="left" class="chinese" ><iframe name="I1" marginwidth="1" marginheight="1" width="180" scrolling="no" align="middle" border="0" frameborder="0" src="hopeshow.asp"> 浏览器不支持嵌入式框架,或被配置为不显示嵌入式框架。</iframe></td>
<td class="chinese" width=380 style="background-image:url('images/textbg.gif');background-repeat: no-repeat;background-position: right bottom" ><br><%=ubb2html(cutstr(formatStr(autourl(rs("d_content"))),700,true,url), true, true)%></td><td background=images/index_diary_21.gif></td>
</tr>
<tr>
<td width=width=380 align=right>
<a href="showdiary.asp?id=<%=rs("d_id")%>" target="_blank">第<%=rs("d_id")%>篇</a> 林子 发表于<%=rs("d_date")%></td><td background=images/index_diary_21.gif><img src=images/index_diary_21.gif border=0></td>
</tr>
<tr><td colspan=4 background=images/index_diary_22.gif ><img src=images/index_diary_22.gif border=0></td></tr>
</table>
</td>
</tr>
<%
i=i+1
rs.movenext
loop
else
If rs.EOF And rs.BOF Then%>
<tr>
<td height="30">正在更新之中........</td>
</tr>
<%end if
end if%>
</table>
<table width="100%" border="0" cellspacing="0" align="center" cellpadding="0">
<form name="form1" method="post" action="index.asp">
<tr>
<td background="images/dotlineh.gif" height="1"></td>
<td background="images/dotlineh.gif"></td>
</tr>
<tr>
<td align="right"> <%=currentpage%>/<%=totalpages%>页,<%=totaldiary%>条记录/<%=diaryperpage%>篇每页.
<%
i=1
dy10=false
showye=totalpages
if showye>15 then
dy10=true
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
<%=i%>
<%else%>
<a href="showdiary.asp?id=<%=rs("d_id")%>" target=_blank><%=i%></a>
<%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
<a href="index.asp?page=<%=page%>" title="下一页"><img src="images/biao.gif" border="0"></a>
<%end if%>
</td>
<td align="right" class="diaryhead">
<%if dy10 then%>
<input type="text" name="page" class="textarea" size="4">
<input type="submit" name="Submit" value="Go" class="button" >
<%end if%>
</tr>
</form>
</table>
<%
rs.close
set rs=nothing
end sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -