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

📄 show_article.asp

📁 blog 又搭工
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="UBBencode.ini"-->
<!--#include file="textencode.ini"-->
<!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 title From article where articleid="&request.QueryString("articleid")
	Set rs=db.Execute(strSql)	
%>
<title><%response.Write rs("Title")%></title>
<%
	rs.close
	set rs=nothing
	%>
	<script language="JavaScript">
        <!--
        function popreg()
        {
          document.form2.username.value==""
        }
        //-->
        </script>
		<style type="text/css">
a.index:hover{
color:#333333;
text-decoration:none;
}
a.index:link{
color:#666666;
text-decoration:underline;
}
a.index:visited{
color:#333333;
text-decoration:none;
}		
</style>
<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">
			<div id="body-top"><a href="index.asp" class="index">首页</a>-->日志篇--><span class="index">查看所有日志</span></div>
			<%
			
			'----------------------------
			
			
			
			
			'查询详细信息来了哦,在article表中把所有的信息全部显示出来
			
			
			'----------------------------
			dim articleid,articleRs,articleSql
			articleid=request.querystring("articleid")
			if articleid="" then
				response.Write "<script>alert('参数错误!');history.back();</script>"
			else
			
			'---------------------
			session("articleid")=articleid
			'先来更新点击率
			'hitsql="update article set hits=hits+1 where articleid="&artilceid
			'db.execute(hitsql)
			hitsql="update article set hits=hits+1 where articleid="&session("articleid")
			db.execute(hitsql)			
			
			'-----------------			
			set articleRs=server.createobject("adodb.recordset")
			articleSql="select  * from article where articleid="&articleid
			articleRs.open articleSql,db,1
			%>
			<div id="left-title"><%=articleRs("title")%></div>
			<div id="left-body-content" style="float:left;">				
				<%=UBBencode(articleRs("body"))%>
				<%'response.write articleRs("articleid")%>	 
			  <hr width="500px" style="margin-top:25px;">
&nbsp;&nbsp;&nbsp;评论(<%=articleRs("renum")%>) | 阅读(<%=articleRs("hits")%>) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=articleRs("subdate")%><br/>
			<br/>
			</div>
		<%
		articleRs.close
		articleRs=nothing
		%>
		
	<!--
	
	
		文章的显示就已经完成了
		
		以下是评论的
		
		
		
		-->
		
		
		
		<div id="left-title" style="color:#ffffff;">博文评论<a name="re" id="re"></a></div>
		<div id="left-body">
		<%
		dim reRs,reSql,flag
		flag=0
		set reRs=server.createobject("adodb.recordset")
		reSql="select  * from re where articleid="&articleid
		reRs.open reSql,db,1
				'-----------------------------------
		
		
		
		
					'这里是回复评论的分页显示
		
		
		
		
					'----------------------------------
		if not reRs.eof and not reRs.bof then
			flag=1
				reRs.pagesize=6
				dim page_total
				page_total=reRs.pagecount
				reRs.absolutepage=page_no
				dim i
				i=6
				do while not reRs.eof and i>0
					i=i-1		%>
			<div id="re"><strong><%=reRs("username")%></strong>&nbsp;&nbsp;&nbsp;<%=reRs("subdate")%><br />
			  <br /> 
		   <table width="100%" style="table-layout: fixed;word-wrap:break-word;">
			  <tr>
			  <td>
		  <%=reRs("body")%>
		  		</td>
				</tr>
			  </table>
		  </div>
		  
		  <%
		   reRs.movenext
		  loop
		  end if
		   '----------------------------
		  '显示完评论了哦
		  '-------------------------------
		  if flag=0 then
		 	 response.write "<font color='red'>暂时还没有评论!</font>"
		  end if		  
		  %>			
		</div>
		
		<div id="page">
		<%
			response.write "共有"&page_total&"页!&nbsp;&nbsp;"
			response.write "当前是第"&page_no&"页!&nbsp;"
			for i=1 to page_total				
		%>
			&nbsp;<a href="show_article.asp?articleid=<%=session("articleid")%>&page_no=<%=i%>&#re"><%=i%></a>&nbsp;
		<%
		next
		 reRs.close
		 reRs=nothing
		 '------------------------------------
		'评论的分页到此结束
		
		'-------------------------------------
		%>
		</div>
		
		<div id="re-body">
	<!--	这个是评论的表单操作-->
	
	
	
		  <form id="form2" name="form2" method="post" action="re_action.asp">大名:
		      <input name="username" type="text" class="btn1" id="username" value="无名" size="20" maxlength="10" onclick="javascript:popreg();" />
		      *(为空将显示为无名)*
			  <br/>     
           &nbsp;&nbsp;&nbsp;内容:
		   <br/>
		    <textarea name="body" cols="60" rows="10" class="btn1" id="body"></textarea>
	        <br />
		   验证码: <input name="verifycode" type="text" class="btn1" size="8" maxlength="4">
       		 <img src="GetCode.asp" height="10" border=0 align="absmiddle">
			          
			   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			   <input name="Submit2" type="submit" class="btn" value="提交" />
			   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		 	   <input name="Submit3" type="reset" class="btn" value="重置" />
		  </form> 
		
		
		 <!--	是评论的表单操作-->			
			
			
		  </div>
			
		</div>
			<!--#include file="right.asp"-->
			<!--#include file="foot.asp"-->
			</td>
			</tr>
			</table>
			<%end if%>
	</div>
</body>
</html>

⌨️ 快捷键说明

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