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

📄 view_article.asp

📁 blog 又搭工
💻 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:125px;
	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>
</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_article.asp" style="margin:0px;" >
		    <label>输入查询关键字:
		      <input name="keyword" type="text" class="btn1" size="40" />
	        </label>
	        &nbsp;&nbsp;
	        <input name="Submit" type="submit" class="btn1" value="搜索" />
		  </form>
	    </div>
		<div id="tools">
		<%
			'--------------------------------------------
			'现在开始显示数据库中的信息主要是文章
			'--------------------------------------------
			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=16
				dim page_total
				page_total=articleRs.pagecount
				articleRs.absolutepage=page_no
				dim i
				i=16
				do while not articleRs.eof and i>0
					i=i-1
	 		 %>
			
			
			
			<!-- 这时显示的是标题-->
			
			
			
			 
			<div id="left-title"><a href="../show_article.asp?articleid=<%=articleRs("articleid")%>" class="page_no" target="_blank" align="left"><%=articleRs("title")%></a>
			
			<!--显示修改信息-->			
			<div id="right">
			<a href="edit_article.asp?articleid=<%=articleRs("articleid")%>" class="page_no">修改</a>
			<a href="delete_article.asp?articleid=<%=articleRs("articleid")%>" class="page_no" >&nbsp;&nbsp;&nbsp;删除&nbsp;&nbsp;&nbsp;</a>
			<a href="../show_article.asp?articleid=<%=articleRs("articleid")%>" class="page_no" target="_blank">查看</a></div>
			</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 "&nbsp;&nbsp;&nbsp;<a href='view_article.asp?page_no=1' class='page'>首页</a>"
			if numpre=0 then
				response.write "&nbsp;&nbsp;&nbsp;上一页"
			else
				response.write "&nbsp;&nbsp;&nbsp;<a href='view_article.asp?page_no="&numpre&"' class='page'>上一页</a>"
			end if
			if numnext>page_total then
				response.write "&nbsp;&nbsp;&nbsp;下一页"	
			else
				response.write "&nbsp;&nbsp;&nbsp;<a href='view_article.asp?page_no="&numnext&"' class='page'>下一页</a>"
			end if
			response.write "&nbsp;&nbsp;&nbsp;<a href='view_article.asp?page_no="&page_total&"' class='page'>尾页</a>"	
	%>
	  <%
	  response.write "&nbsp;&nbsp;&nbsp;现在是第&nbsp;<font color='red'>"&page_no&"</font>&nbsp;页,"
	 response.write "&nbsp;&nbsp;&nbsp;共有&nbsp;"&page_total&"&nbsp;页,"	
	  %>
		<div align="center">
		<%
	'--------------------------------------------------------------------------------------
	'这一段输出页数信息。Page_total由上面分页显示决定。
	Response.Write "<p align='center'><b><font color='#CC0066'>" & page_no & "/" & page_total & "</b></font>页&nbsp;"
	'显示往前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>&nbsp"
	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>&nbsp;"
		Else
			Response.Write "<a href='view_article.asp?page_no=" & I & "'>" & I & "</a>&nbsp"
		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>&nbsp"
	End If
	%>		</div>
		</div>
	
	</div>
</body>
</html>

⌨️ 快捷键说明

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