?? show_article.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;">
評論(<%=articleRs("renum")%>) | 閱讀(<%=articleRs("hits")%>) <%=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> <%=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&"頁! "
response.write "當前是第"&page_no&"頁! "
for i=1 to page_total
%>
<a href="show_article.asp?articleid=<%=session("articleid")%>&page_no=<%=i%>&#re"><%=i%></a>
<%
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/>
內容:
<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">
<input name="Submit2" type="submit" class="btn" value="提交" />
<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 + -