📄 view_re.asp
字号:
<!--#include file="conn.asp"-->
<!--#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" />
<title>评论显示</title>
<style type="text/css">
body{
margin:0px;
background-color:#FF9900;
}
#all{
width:780px;
margin-right:auto;
padding-left:10px;
}
#title_top{
width:780px;
height:30px;
background-color:#FFFFFF;
text-align:center;
font-weight:bolder;
padding-top:10px;
border: 1px double #333333;
color:orange;
}
#tools{
width:780px;
height:auto;
background-color:#CCCCCC;
text-align:center;
font-weight:bolder;
border: 1px solid #999999;
padding-top:5px;
padding-bottom:5px;
FILTER:progid:DXImageTransform.Microsoft.Gradient(startColorStr='orange', endColorStr='white', gradientType='1');
}
#body{
width:776px;
height:auto;
background-color:#ffffff;
border: 1px solid #999999;
padding-top:8px;
padding-bottom:8px;}
#page{
width:780px;
height:auto;
text-align:center;
background-color:white;
font-size:12px;
text-decoration:none;
padding-top:8px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: dotted;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: none;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
padding-bottom:15px;
color:#666666;
}
#left-title{
font-weight:normal;
padding-top:8px;
padding-left:10px;
width:770px;
padding-bottom:8px;
height:25px;
background-color:#EEEEEE;
/*margin-top:5px;*/
border: 1px solid #666666;
font-size: 13px;
text-align:left;
}
#right{
width:80px;
padding-top:2px;
padding-bottom:2px;
height:auto;
margin:0px;
background-color:#ffffff;
white-space:normal;
font-size:13px;
margin-right:10px;
border: 1px solid #666666;
white-space:normal;
float:right;
color:balck;
}
a.page:link{
color:#9F7800;
text-decoration:none;
}
a.page:hover{
text-decoration:none;
color:#339933;
}
a.page:visited{
color:#000000;
text-decoration:none;}
a.page_no:link{
color:#9F7800;
text-decoration:none;
float:left;
}
a.page_no:hover{
text-decoration:none;
color:#339933;
float:left;
}
a.page_no:visited{
color:#000000;
text-decoration:none;
float:left;
}
.btn1{
background-color: #FEF8ED;
border: 1px solid #599F33;
}
</style>
<script language="JAVASCRIPT">
function check_Null(){
if (document.form1.keyword.value==""){
alert("请输入关键字!");
return false;
}
return false;
}
</script>
</head>
<body>
<div id="all">
<%
dim page_no
'page_no=request.QueryString("page_no"))
if request.QueryString("page_no")="" then
page_no=1
session("page_no")=page_no
else
page_no=cint(request.QueryString("page_no"))
session("page_no")=page_no
end if
%>
<div id="title_top">所有评论</div>
<div id="title_top">
<form id="form1" name="form1" method="post" action="search_re.asp" style="margin:0px;" >
<label>输入查询关键字:
<input name="keyword" type="text" class="btn1" size="40" />
</label>
<input name="Submit" type="submit" class="btn1" value="搜索" />
</form>
</div>
<div id="tools">
<%
'--------------------------------------------
'现在开始显示数据库中的信息主要是文章
'--------------------------------------------
dim reRs,reSql
set reRs=server.createobject("adodb.recordset")
reSql="select * from re order by subdate desc"
reRs.open reSql,db,1
'--------------------------------
'开始分页显示
'----------------------------------
if not reRs.eof and not reRs.bof then
reRs.pagesize=16
dim page_total
page_total=reRs.pagecount
reRs.absolutepage=page_no
dim i
i=16
do while not reRs.eof and i>0
i=i-1
%>
<!-- 这时显示的是标题-->
<div id="left-title"><a href="../show_article.asp?articleid=<%=reRs("articleid")%>&#re" class="page_no" target="_blank">
<%if len(reRs("body"))>30 then
response.Write left(reRs("body"),30)&"..."
else
response.Write reRs("body")
end if
%></a>
<!--显示修改信息-->
<div id="right"><a href="delete_re.asp?reid=<%=reRs("reid")%>">删除</a> | <a href="../show_article.asp?articleid=<%=reRs("articleid")%>&#re" target="_blank">查看</a> </div>
</div>
<%
'----------------------------
'这里结束了
'----------------------------------
reRs.movenext
loop
end if
reRs.close
set reRs=nothing
%>
<div id="page">
<%
dim numpre,numnext
numpre=page_no-1
numnext=page_no+1
response.write " <a href='view_re.asp?page_no=1' class='page'>首页</a>"
if numpre=0 then
response.write " 上一页"
else
response.write " <a href='view_re.asp?page_no="&numpre&"' class='page'>上一页</a>"
end if
if numnext>page_total then
response.write " 下一页"
else
response.write " <a href='view_re.asp?page_no="&numnext&"' class='page'>下一页</a>"
end if
response.write " <a href='view_re.asp?page_no="&page_total&"' class='page'>尾页</a>"
%>
<%
response.write " 现在是第 <font color='red'>"&page_no&"</font> 页,"
response.write " 共有 "&page_total&" 页,"
%>
<div align="center">
<%
'--------------------------------------------------------------------------------------
'这一段输出页数信息。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='view_article.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='view_article.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='view_article.asp?page_no=" & numTemp & "'>后10页</a> "
End If
%> </div>
</div>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -