📄 topic.asp
字号:
<%@ Language=VBScript %>
<!--#INCLUDE FILE="conn.asp" -->
<%id=request("id")
if id="" then
response.redirect "erro.asp"
response.end
end if
%>
<!--#INCLUDE FILE="copyright.asp" -->
<%id=request("id")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="update book set hits=hits+1 where id="&id&""
rs.open sql,conn,1,1
sql = "Select * FROM book where reid="&id&" Order By id asc"'升序
rs.open sql,conn,1,1
Set rs2 = Server.CreateObject("ADODB.Recordset")
sql2 ="SELECT * From config Order By id DESC"
RS2.open sql2,Conn,3,3
'----------------------------------------------
IF not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Then
page=1
Else
Page=Int(Abs(Request("page")))
End if
rs.pagesize = rs2("num")'------------------每页显示留言数
mypagesize = rs.pagesize
rs.absolutepage = page
%>
<html>
<%
if session("a")="1" then
admin="1"
end if
%>
<!--#INCLUDE FILE="config.asp" -->
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=rs2("title")%>-查看贴子</title>
</head>
<%top%>
<br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#808080" width="100%" id="AutoNumber5" height="23" bgcolor="#F5F5F5">
<tr>
<td width="100%" height="23"> <a href="add.asp">发表新贴</a>
<a href="reply.asp?id=<%=request("id")%>">回复贴子</a></td>
</tr>
</table>
<BR>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#99CC00" width="100%" id="AutoNumber1" height="135">
<tr>
<td width="100%" height="22" colspan="2" bgcolor="#F5F5F5"> <font color="#80AA00"><U>主题:<%=rs("subject")%></U></font></td>
</tr>
<%
do while not rs.eof and mypagesize>0
note=rs("note")
note=TxtTourl(note)
%>
<%
if i = 0 then
CColor = ""&rs2("color1")&""
else
CColor = ""&rs2("color2")&""
end if
%>
<tr>
<td width="12%" height="109" bgcolor="<%=Ccolor%>">
<div align="center">
<center>
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="60%" id="AutoNumber2" height="92">
<tr>
<td width="100%" height="25" align="center" valign="top">
<img border="0" src="img/<%=rs("s")%>.gif"></td>
</tr>
<tr>
<td width="100%" height="16" align="center" valign="top"><%=rs("n")%></td>
</tr>
<tr>
<td width="100%" height="16" align="center" valign="top"><%=rs("f")%></td>
</tr>
<tr>
<td width="100%" height="16" align="center" valign="top">QQ:<%=rs("q")%></td>
</tr>
</table>
</center>
</div>
</td>
<td width="81%" height="109" bgcolor="<%=Ccolor%>">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="662" id="AutoNumber4" height="4">
<tr>
<td width="654" style="font-size: 2pt" height="3" colspan="3"></td>
</tr>
<tr>
<td width="6" height="4" style="font-size: 2pt"></td>
<td width="652" height="4"><%if rs("board")=1 then%>发表<%else%>回复<%end if%>时间:<%=rs("t")%> IP:<%=rs("ip")%></td>
<td width="4" height="4"></td>
</tr>
<tr>
<td width="6" height="1" style="font-size: 2pt"></td>
<td width="652" height="1"><hr color="#808080" size="1"></td>
<td width="4" height="1"></td>
</tr>
<tr>
<td width="6" height="1" style="font-size: 2pt" rowspan="2"></td>
<td width="652" height="12"><font color="#0000FF"><b>主题:<%=rs("subject")%></b></font></td>
<td width="4" height="1" rowspan="2"></td>
</tr>
<tr>
<td width="652" height="4" style="font-size: 3pt"></td>
</tr>
<tr>
<td width="6" height="106" style="font-size: 2pt" rowspan="3"> </td>
<td width="652" height="90"><%=note%></td>
<td width="4" height="106" rowspan="3"> </td>
</tr>
<tr>
<td width="652" height="9"><hr color="#808080" size="1"></td>
</tr>
<%topicid=request("id")%>
<tr>
<td width="652" height="7"><%if rs("e")="" then%><font color="#808080">E-mail
</font><%else%><a href="mailto:<%=rs("e")%>">E-mail</a> <%end if%>
<% if rs("h")="还没有!" then%><font color="#808080">Homepage</font><%else%> <a target="_blank" href="<%=rs("h")%>">Homepage</a><%end if%><%if admin="1" then%>
<%if rs("board")=0 then %><a href="delid.asp?id=<%=rs("id")%>&topicid=<%=topicid%>&id2=<%=rs("board")%>"><%else%><a href="delid.asp?id=<%=rs("id")%>"><%end if%><u>
<font color="#FF0000">Delete</font></u></a> <font color="#FF0000">
<u><a title="编辑这个贴子" href="edit.asp?id=<%=rs("id")%>"><font color="#FF0000">Edit</font></a></u><%end if%></font></td>
</tr>
<tr>
<td width="654" style="font-size: 2pt" height="3" colspan="3"></td>
</tr>
</table>
</td>
</tr>
<%
mypagesize=mypagesize-1
rs.movenext
i = i + 1
if i = 2 then i = 0
loop%>
</table>
<br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#808080" width="100%" id="AutoNumber3" height="22" bgcolor="#F5F5F5">
<tr>
<td width="19%" height="22" bgcolor="#E4E4E4">
<p align="center"><p align="center">贴子数:<%=rs.RecordCount%> 页数:<%=rs.pagecount%></td>
<td width="81%" height="22">
<p align="center"><%
if page>1 then%>
<a href='topic.asp?id=<%=request("id")%>&page=<%=page-1%>'>上一页</a>
<%
end if
%>
<%
if rs.pagecount <= 8 then
for j=1 to rs.pagecount
response.write "<a href='topic.asp?id="&request("id")&"&page="&j&"'>"&j&"</a>"'--------------暂时先用这吧
next
else
for j=1 to 8
response.write "<a href='topic.asp?page="&j&"'>"&j&"</a> "
next
response.write "<a href='topic.asp?page="&rs.pagecount&"' title='最后一页'>>></a>"
end if
%>
<%
if page<rs.pagecount then%>
<a href='topic.asp?id=<%=request("id")%>&page=<%=page+1%>'>下一页</a>
<%
end if
%></td>
</tr>
</table>
<br>
<%copyright%></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -