📄 index.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="UBBencode.ini"-->
<!--#include file="textencode.ini"-->
<!--#include file="function.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%
strSql="Select blogTitle From config"
Set rs=db.Execute(strSql)
%>
<title><%response.Write rs("blogTitle")%></title>
<%
rs.close
set rs=nothing
%>
<link href="blog.css" rel="stylesheet" type="text/css" />
<script>
/*function Wa_SetImgAutoSize(obj)
{
var IMG=obj;
var MaxWidth=500;
var MaxHeight=400;
var HeightWidth=IMG.offsetHeight/IMG.offsetWidth;
var WidthHeight=IMG.offsetWidth/IMG.offsetHeight;
if(IMG.readyState!="complete")return false;
if(IMG.offsetWidth>MaxWidth){
IMG.width=MaxWidth;
IMG.height=MaxWidth*HeightWidth;
}
if(IMG.offsetHeight>MaxHeight){
IMG.height=MaxHeight;
IMG.width=MaxHeight*WidthHeight;
}
} */
</script>
</head>
<body>
<%
dim page_no
'page_no=request.QueryString("page_no"))
if request.QueryString("page_no")="" then
page_no=1
else
page_no=cint(request.QueryString("page_no"))
end if
%>
<div id="all">
<table border="1" bgcolor="#999999" width="100%" height="100%">
<tr>
<td bgcolor="#E7E7E7">
<!--#include file="top.asp"-->
<div id="left-bg">
<%
'--------------------------------------------
'现在开始显示数据库中的信息主要是文章
'--------------------------------------------
dim articleRs,articleSql
set articleRs=server.createobject("adodb.recordset")
articleSql="select * from article order by subdate desc"
articleRs.open articleSql,db,1
'--------------------------------
'开始分页显示
'----------------------------------
if not articleRs.eof and not articleRs.bof then
articleRs.pagesize=10
dim page_total
page_total=articleRs.pagecount
articleRs.absolutepage=page_no
dim i
i=10
do while not articleRs.eof and i>0
i=i-1
%>
<div id="left-title"><a href="show_article.asp?articleid=<%=articleRs("articleid")%>" class="titlemenu" target="_blank"><%=articleRs("title")%></a></div>
<div id="left-body">
<%
dim str,num,flag
'str="</P>"
str="</P>"
'strtemp=server.HTMLEncode(articleRs("body"))
strtemp=articleRs("body")
num=instr(strtemp,str)
'response.write num
'response.Write strtemp
textnum=mid(articleRs("body"),1,num-1)
if num=0 then
response.Write articleRs("body")
else
response.write textnum
end if
%>
<hr width="500px" style="margin-top:30px;">
评论(<%=articleRs("renum")%>) | 阅读(<%=articleRs("hits")%>) 发表时间:<%=articleRs("subdate")%>
</div>
<%
'----------------------------
'这里结束了
'----------------------------------
articleRs.movenext
loop
end if
articleRs.close
set articleRs=nothing
%>
<div id="page">
<%
dim numpre,numnext
numpre=page_no-1
numnext=page_no+1
response.write " <a href='index.asp?page_no=1' class='page'>首页</a>"
if numpre=0 then
response.write " 上一页"
else
response.write " <a href='index.asp?page_no="&numpre&"' class='page'>上一页</a>"
end if
if numnext>page_total then
response.write " 下一页"
else
response.write " <a href='index.asp?page_no="&numnext&"' class='page'>下一页</a>"
end if
response.write " <a href='index.asp?page_no="&page_total&"' class='page'>尾页</a>"
%>
<%
response.write " 现在是第 <font color='red'>"&page_no&"</font> 页,"
response.write " 共有 "&page_total&" 页,"
%>
<%
'--------------------------------------------------------------------------------------
'这一段输出页数信息。Page_total由上面分页显示决定。
Response.Write "<p align='center'><b><font color='#CC0066'>" & page_no & "/" & page_total & "</b></font>页 "
'显示往前10页的链接,为当前最小值减1
Dim numTemp
numTemp=minPage(page_no,page_total)-1
If numTemp>=1 Then
Response.Write "<a href='index.asp?page_no=" & numTemp & "'>前10页</a> "
End If
'显示当前10页的链接
For I=minPage(page_no,page_total) To maxPage(page_no,page_total)
If I=page_no Then
Response.Write "<b><font color='#CC0066'>" & I & "</font></b> "
Else
Response.Write "<a href='index.asp?page_no=" & I & "'>" & I & "</a> "
End If
Next
'显示往后10页的链接,为当前最大值加1
numTemp=maxPage(page_no,page_total)+1
If numTemp<page_total Then
Response.Write "<a href='index.asp?page_no=" & numTemp & "'>后10页</a> "
End If
%>
</div>
</div>
<!--#include file="right.asp"-->
<!--#include file="foot.asp"-->
</td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -