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

📄 newtopic.asp

📁 功能强大的一个b/s工作站
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
dim bbsurl,lockboardid
'############以下为修改项######################
bbsurl="http://www.www.com/bbs/"  '请填写你论坛的正确地址,要以"HTTP://"开头
lockboardid="1,2,3"	             '请填写不被调用的论坛版块ID,用逗号隔开。(当LOCKID参数=1,boardid=all时才生效)
'############以上为修改项######################
'bbsurl=getservepath(request.ServerVariables("server_name")&request.ServerVariables("URL"))
'function getservepath(str)
'dim tmpstr
'tmpstr=split(str,"/")
'getservepath="http://"&replace(str, tmpstr(ubound(tmpstr)), "")
'end function
'*************************************
'上传到与CONN.ASP同级的目录下
'以上地址参数一定要修改,否则所调用的链接是去了以上的论坛.
'若有问题,可以运行一起上传的newscode.ASP文件进行调试(newscode.ASP运行前要修改调用参数)
'	FSSUNWIN	2002.12.31
'*************************************

Rem 过滤HTML代码
function HTMLEncode(fString)
if not isnull(fString) then
    fString = replace(fString, ">", "&gt;")
    fString = replace(fString, "<", "&lt;")

    fString = Replace(fString, CHR(32), "&nbsp;")
    fString = Replace(fString, CHR(9), "&nbsp;")
    fString = Replace(fString, CHR(34), "&quot;")
    fString = Replace(fString, CHR(39), "&#39;")
    fString = Replace(fString, CHR(13), "")
    fString = Replace(fString, CHR(10) & CHR(10), "&nbsp; ")
    fString = Replace(fString, CHR(10), "&nbsp; ")

    HTMLEncode = fString
end if
end function

	dim rs,sql
	dim orders,reply,topic,isbest
    dim board
    dim bname,ars
    dim postname
    dim postinfo,POSTTIME
	dim NowUseBBS

	if trim(request("orders"))=1 then
		orders="hits"
	else
		orders="dateandtime"
	end if
	if trim(request("boardid"))="all" then
            board=""
			if cint(trim(request("lock")))=1 then
			board=" and boardid not in ("&lockboardid&") "
			end if
        else
			if isnumeric(request("boardid"))	then
            board=" and boardid="&cint(trim(request("boardid")))&""
			else
			board=""
			end if
        end if
	set rs=conn.execute("select top 1 NowUseBBS from config where active=1 ")
	NowUseBBS=rs(0)
	set rs=nothing

	if cint(request("action"))=1 then
	'显示主题
	if trim(request("orders"))=2 then orders="lastposttime"
          set rs=conn.execute("select top "&cint(request("n"))&" PostUserName,Title,topicid,boardid,dateandtime,topicid,hits,LastPost from topic where  datediff('d',dateandtime,Now())<"&cint(request("sdate"))&"  "&board&"  ORDER BY "&orders&" desc")
	elseif cint(request("action"))=2 then
        '显示精华主题
          set rs=conn.execute("select top "&cint(request("n"))&" PostUserName,Title,rootid,boardid,dateandtime,Announceid,id from BestTopic where  datediff('d',dateandtime,Now())<"&cint(request("sdate"))&"  "&board&"  ORDER BY "&orders&" desc")
     else
          set rs=conn.execute("select top "&cint(request("n"))&" username,topic,rootid,boardid,dateandtime,announceid,body from "&NowUseBBS&" where  datediff('d',dateandtime,Now())<"&cint(request("sdate"))&"  "&board&" ORDER BY "&orders&" desc")
        '显示主题或回复
     end if

	do while Not RS.Eof
       postname=rs(0)
       POSTTIME=rs(4)
	if request("action")=1 and request("reply")=1 then
          if  rs("LastPost")<>"" then
		postinfo=split(rs("LastPost"),"$")
        postname=postinfo(0)
        POSTTIME=postinfo(2)
          end if
     end if
       topic=rs(1)
     if topic="" then
          topic=rs(6)
     end if
     if len(topic)>Cint(request("tlen")) then
        topic=left(topic,request("tlen"))&"..."
     end if
      topic=htmlencode(topic)
	response.write "document.write('<FONT color=#CCCCCC><B>·</B></FONT><span style=""font-size:9pt;line-height: 13pt"">');"
	if request("bname")=1 then
	set ars=conn.execute("select BoardType from board where boardid="&rs(3))
	response.write "document.write('<a href="&bbsurl&"list.asp?boardid="&rs(3)&" target=_blank><font color=#333333>"&htmlencode(ars(0))&"</font></a>');"
	end if
    response.write "document.write('<a href="&bbsurl&"dispbbs.asp?boardid="&rs(3)&"&ID="&rs(2)&"&replyID="&rs(5)&" target=_blank title="&htmlencode(topic)&">');"
    response.write "document.write('<font color=#F2A400>"&topic&"</font>');"
	response.write "document.write('</a>');"

	select case cint(request("info"))
	case 0
	case 1
	response.write "document.write('

⌨️ 快捷键说明

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