📄 new.asp
字号:
<!-- #include file="conn.asp" -->
<%
'=========================================================
' 调用标题代码
'<span id=yuzi>Loading...</span>
'<script src=new.asp?id=yuzi&forumid=1&TopicCount=10&Count=15&showtime=1&icon=◎></script>
'---------------------------------------------------------
' 调用内容代码
'<span id=yuzi>Loading...</span>
'<script src=new.asp?id=yuzi&showcontent=1&icon=◎></script>
'---------------------------------------------------------
' id: 定义识别代码[其中“yuzi”可自定义,如一个页面多个调用请各自更改不同的代码,共2处需要修改]
' forumid: 指定论坛的ID
' TopicCount: 显示多少条主题
' Count: 标题 长度
' showtime: 1=显示时间 0=不显示时间
' showcontent:1=显示内容 0=不显示内容
' icon: 标题前的符号
'=========================================================
forumid=int(Request("forumid"))
if Request("TopicCount")=empty then
TopicCount=10
else
TopicCount=int(Request("TopicCount"))
end if
if TopicCount>100 then Response.End
if Request("Count")=empty then
Count=100
else
Count=int(Request("Count"))
end if
cluburl=Conn.Execute("Select cluburl From clubconfig")(0)
if forumid <> empty then sqlforumid=" and forumid="&forumid&""
sql="select top "&TopicCount&" * from forum where deltopic=0 "&sqlforumid&" order by id desc"
Set Rs=Conn.Execute(sql)
do while Not RS.Eof
if Request("showcontent")=1 then
content=ReplaceText(rs("content"),"<[^>]*>","")
if len(content)>200 then content=left(""&content&"",200)&"..."
list=list&" <table border=0 width="&CHR(34)&"100%"&CHR(34)&" style=TABLE-LAYOUT:fixed><tr><td>"&Request("icon")&" <a href="&cluburl&"ShowPost.asp?id="&rs("id")&" target=_blank>"&rs("Topic")&"</a><br><br>"&content&"</td></tr><tr><td align=right><a href="&cluburl&"ShowPost.asp?id="&rs("id")&" target=_blank><u> "&rs("username")&" 发表于 "&rs("posttime")&" - "&rs("replies")&" 个评论</u></a></td></tr></table><hr>"
else
topic=ReplaceText(rs("topic"),"<[^>]*>","")
if Request("showtime")=1 then showtime=" ["&rs("lasttime")&"]"
list=list&""&Request("icon")&" <a href="&cluburl&"ShowPost.asp?id="&rs("id")&" target=_blank>"&left(topic,Count)&"</a>"&showtime&"<br>"
end if
RS.MoveNext
Loop
set rs=nothing
conn.close
set conn=nothing
''''''''''替换模块START''''''''''''
Function ReplaceText(fString,patrn,replStr)
Set regEx = New RegExp ' 建立正则表达式。
regEx.Pattern = patrn ' 设置模式。
regEx.IgnoreCase = True ' 设置是否区分大小写。
regEx.Global = True ' 设置全局可用性。
ReplaceText = regEx.Replace(fString, replStr) ' 作替换。
Set reg=nothing
End Function
''''''''''替换模块END''''''''''''
%>
<%=Request("id")%>.innerHTML='<%=list%>'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -