📄 latestthresd.asp
字号:
<%
''''''''''''''''''''''''''''''''''''''''
' SF2.0 新帖调用代码
' 作者: 雪人
' 2003.6.22
'
''''''''''''''''''''''''
' 将本程序上传到你的SF2论坛运行, 也可以用框架等方式调用在首页显示.
''''''''''''''''''''''''''''''''''''''''
' 设置显示多少个最新帖子, 默认TopNum = 20 (即20个)
TopNum = 20
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>SF2新帖调用</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type="text/css">
<!--
body { font-family: "Tahoma", "Verdana"; font-size: 12px; color: #333333}
td { font-family: "Tahoma", "Verdana"; font-size: 12px; color: #333333}
a { font-family: "Tahoma", "Verdana"; color: #3399CC}
-->
</STYLE>
</head>
<body bgcolor="#FFFFFF" text="#000000" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
最新帖子:
<br><br>
<table width="100%" border="0" cellspacing="1" cellpadding="4">
<!--#INCLUDE FILE="inc/db_inc.asp"-->
<!--#INCLUDE FILE="inc/char_inc.asp"-->
<!--#INCLUDE FILE="header.asp"-->
<%
Set rs = Conn.execute("select top 20 threadid, title, postusername, postuserid, dateline from sf_thread where visible = 1 order by threadid DESC")
'''''''''''''''''''''
' 注意: 如果只是调用某个版块的新帖子就需要在sql查询中加 forumid=版块id 这个条件, 例如查询forumid为1的版块的最新帖子:
' Set rs = Conn.execute("select top 20 threadid, title, postusername, postuserid, dateline from sf_thread where visible = 1 and forumid = 1 order by threadid DESC")
'''''''''''''''''''''
if rs.bof or rs.eof then
response.write "无任何内容"
else
do until rs.eof
response.write "<tr><td width=""60%""><a href=""showthread.asp?threadid=" & rs("threadid") & """ target=""_blank"">" & rs("title") & "</a></td><td width=""40%""><font color=""#666666"">--- " & rs("postusername") & " " & rs("dateline") & "</font></td></tr>"
rs.movenext
loop
end if
Conn.close
Set rs = nothing
Set Conn = nothing
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -