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

📄 index.asp

📁 现在好了
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/dv_clsother.asp"-->
<%
Dim ChildTopicNum,Page,action,TopicNum,XMLDOM,XMLStyle,XSLT,ListNodeObject
Dim BoardTopic,BoardTopicImg,BoardTopicMode,BoardTopicMode_a,iii,TopicMode,SelectBoardTopic,Forum_AllTopNum
If Request("action")<>"xml" Then
	Main
Else
	Showxml()
End If
Sub Showxml()
	Set XMLDOM=Application(Dvbbs.CacheName&"_sBoradlist").cloneNode(True)
	XMLDOM.validateOnParse = False
	XMLDOM.resolveExternals = False
	Dim node
	If Dvbbs.GroupSetting(37)="0"  Then'去掉隐藏论坛
		For each node in XMLDOM.documentElement.getElementsByTagName("board")
			If node.attributes.getNamedItem("hidden").text="1" Then
				node.parentNode.removeChild(node)
			End If
		Next
	End If
	Response.Clear
	Response.CharSet="gb2312"  
	Response.ContentType="text/xml"
	Response.Write "<?xml version=""1.0"" encoding=""gb2312""?>"&vbNewLine
	Response.Write XMLDom.documentElement.XML
	'输出版面总数据
	'Response.Write Dvbbs.BoardXML.documentElement.XML
	Set XMLDOM=Nothing
End Sub
Sub Main()
	Dvbbs.LoadTemplates("index")
	If Dvbbs.BoardID < 0 Then
		Response.Write "参数错误"
		Exit Sub
	End If
	Select Case Dvbbs.BoardID
		Case "0"
			Show_Index_Main()
		Case "444"
			Response.Write "参数错误"
			Exit Sub
		Case "777"
			Response.Write "参数错误"
			Exit Sub
		Case Else
			Chk_List_Err
			If Cint(Dvbbs.Board_Setting(43))=0 Then
				Dvbbs.Stats=Dvbbs.LanStr(7)
			Else
				Dvbbs.Stats=Dvbbs.LanStr(8)
			End If
			Dvbbs.Nav()
			Dvbbs.ActiveOnline()	
			Dvbbs.Head_var 1,Dvbbs.BoardNode.attributes.getNamedItem("depth").text,"",""
			ChildTopicNum = 0
			GetForumTextAd(1)
			'如果有下属版面,则显示Board_Data(6,0)
			If Not (Dvbbs.BoardNode.selectSingleNode("board") is Nothing) Then
				Show_Index_BoardList
			End If
			If Dvbbs.boardmaster or Dvbbs.master or Dvbbs.superboardmaster Then
				action=Request("action")
			ElseIf Dvbbs.GroupSetting(45)=1 Then
				action=Request("action")
			Else
				action=""
			End If
			
			TopicMode=0
			BoardTopic=Split(Dvbbs.Board_Setting(48),"$$")
			BoardTopicImg=Split(Dvbbs.Board_Setting(49),"$$")
			If Ubound(BoardTopic)>0 Then
				If Request("topicmode")<>"" and IsNumeric(Request("topicmode")) Then TopicMode=Cint(Request("topicmode"))
				For iii=0 to Ubound(BoardTopic)-1
					If BoardTopicImg(iii)<>"" and Instr(BoardTopicImg(iii),".gif") Then BoardTopicMode=BoardTopicMode+"<img src="&BoardTopicImg(iii)&" border=0  align=absmiddle>"
					BoardTopicMode=BoardTopicMode+"<a href=index.asp?boardid="&Dvbbs.boardid&"&topicmode="&iii+1&">["
					BoardTopicMode_a=BoardTopicMode_a+"<a href=index.asp?boardid="&Dvbbs.boardid&"&topicmode="&iii+1&">["
					If TopicMode=iii+1 Then
						BoardTopicMode=BoardTopicMode+"<font color="&Dvbbs.mainsetting(1)&">"&BoardTopic(iii)&"</font>"
						BoardTopicMode_a=BoardTopicMode_a+"<font color="&Dvbbs.mainsetting(1)&">"&BoardTopic(iii)&"</font>"
					Else 
						BoardTopicMode=BoardTopicMode+BoardTopic(iii)
						BoardTopicMode_a=BoardTopicMode_a+BoardTopic(iii)
					End If
					BoardTopicMode=BoardTopicMode+"]</a>"
					BoardTopicMode_a=BoardTopicMode_a+"]</a>"
					SelectBoardTopic=SelectBoardTopic+"<option value="&(iii+1)
					SelectBoardTopic=SelectBoardTopic+" >"&BoardTopic(iii)&"</option>"
					If iii<>(Ubound(BoardTopic)-1) Then
						BoardTopicMode=BoardTopicMode+ " | "
						BoardTopicMode_a=BoardTopicMode_a+ " | "
					End If
				Next
			End If
			'分版浮动广告
			If Dvbbs.Forum_ads(2)="1" or Dvbbs.Forum_ads(13)="1" Then Response.Write "<script language=""javascript"" src=""inc/Dv_Adv.js""></script>"
			If Dvbbs.Board_Setting(43)="0" Then
				Call News
				Call Board_Rules
				Call Board_Online
				Call Show_List_Top
				Show_TopicList_Top()
			Else
				Response.Write "<iframe width=""0"" height=""0"" src="""" name=""hiddenframe""></iframe>"
			End If
	End Select
	Dvbbs.Footer
End Sub

Sub Show_TopicList_Top()
	Dim CMD,limitime,n 
	If TopicMode>0 Then
		Set Rs=Dvbbs.Execute("Select count(Topicid) From Dv_topic Where Boardid="&Dvbbs.Boardid&" and mode="&TopicMode)
		TopicNum=Rs(0)
		Rs.close:Set Rs=Nothing
	Else
		TopicNum = Int(Dvbbs.BoardNode.attributes.getNamedItem("topicnum").text) - ChildTopicNum
	End If
	Set XMLDOM=Application(Dvbbs.CacheName&"_topiclist").cloneNode(True)
	XMLDOM.validateOnParse = False
	XMLDOM.resolveExternals = False
    'XMLDOM.preserveWhiteSpace = False

	Set ListNodeObject=XMLDOM.documentElement.selectSingleNode("DvCopy/list")
	Set XSLT=Application(Dvbbs.CacheName&"_listtemplate_"&Dvbbs.SkinID)
	Page=Request("Page")
	If isNumeric(Page) = 0 or Page="" Then Page=1
	Page=Clng(Page)
	If Page=1 Then
		Forum_AllTopNum=Dvbbs.CacheData(28,0)
		If Trim(Dvbbs.BoardNode.attributes.getNamedItem("boardtopstr").text)<>"" Then
			If Trim(Forum_AllTopNum)<>"" Then
				Forum_AllTopNum = Forum_AllTopNum & ("," & Dvbbs.BoardNode.attributes.getNamedItem("boardtopstr").text)
			Else
				Forum_AllTopNum = Dvbbs.BoardNode.attributes.getNamedItem("boardtopstr").text
			End If
		End If
		If Trim(Forum_AllTopNum)<>"" Then
			Dim Rs,SQL,i,TopicTempStr,Showtitle,postusername,UseTools
			Set Rs=Dvbbs.Execute("Select TopicID,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,istop,isvote,isbest,locktopic,Expression,TopicMode,Mode,GetMoney,GetMoneyType,UseTools,IsSmsTopic from dv_topic Where istop>0 and TopicID in ("&Forum_AllTopNum&") Order By istop desc, Lastposttime Desc")
			If Rs.Eof And Rs.Bof Then
				Forum_AllTopNum = 0
			Else
				SQL=Rs.GetRows(-1)
				Forum_AllTopNum = 0
				TopicListToXML SQL,1
				SQL=Null
			End If
			Rs.Close
			Set Rs=Nothing
		Else
			Forum_AllTopNum = 0
		End If
	End If

	If Dvbbs.BoardNode.attributes.getNamedItem("toptopiccount").text = "" Then
		Dvbbs.BoardNode.attributes.getNamedItem("toptopiccount").text = Forum_AllTopNum
		Dvbbs.NodeUpdate = True
	Else
		Forum_AllTopNum = Replace(Dvbbs.BoardNode.attributes.getNamedItem("toptopiccount").text,"_TopTopic","")
	End If

	If Not IsNumeric(Forum_AllTopNum) Then Forum_AllTopNum = 0
	TopicNum = TopicNum - Forum_AllTopNum
	If IsSqlDataBase=1 And IsBuss=1 Then
		Set Cmd = Server.CreateObject("ADODB.Command")
		Set Cmd.ActiveConnection=conn
		Cmd.CommandText="dv_list"
		Cmd.CommandType=4
		Cmd.Parameters.Append cmd.CreateParameter("@boardid",3)
		Cmd.Parameters.Append cmd.CreateParameter("@pagenow",3)
		Cmd.Parameters.Append cmd.CreateParameter("@pagesize",3)
		Cmd.Parameters.Append cmd.CreateParameter("@tl",3)
		Cmd.Parameters.Append cmd.CreateParameter("@topicmode",3)
		Cmd.Parameters.Append cmd.CreateParameter("@totalrec",3,2)
		Cmd("@boardid")=Dvbbs.BoardID
		Cmd("@pagenow")=page
		Cmd("@pagesize")=Cint(Dvbbs.Board_Setting(26))
		Cmd("@topicmode")=TopicMode
		If limitime="" Then
			Cmd("@tl")=0
		Else
			Cmd("@tl")=limitime
		End If
		set Rs=Cmd.Execute
	Else
		Set Rs = Server.CreateObject ("adodb.recordset")
		If Cint(TopicMode)=0 Then
			Sql="Select TopicID,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,istop,isvote,isbest,locktopic,Expression,TopicMode,Mode,GetMoney,GetMoneyType,UseTools,IsSmsTopic From Dv_Topic Where BoardID="&Dvbbs.BoardID&" And IsTop=0 Order By LastPostTime Desc"
		Else
			Sql="Select TopicID,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,istop,isvote,isbest,locktopic,Expression,TopicMode,Mode,GetMoney,GetMoneyType,UseTools,IsSmsTopic From Dv_Topic Where BoardID="&Dvbbs.BoardID&" And IsTop=0 And Mode="&TopicMode&" Order By LastPostTime Desc"
		End If
		Rs.Open Sql,Conn,1,1
	End If
	Dvbbs.SqlQueryNum = Dvbbs.SqlQueryNum + 1
	If Not (Rs.Eof And Rs.Bof) Then
		If IsSqlDatabase = 1 And IsBuss=1 Then
			SQL=Rs.GetRows(-1)
		Else
			If TopicNum Mod Cint(Dvbbs.Board_Setting(26))=0 Then
				n = TopicNum \ Cint(Dvbbs.Board_Setting(26))
			Else
	     		n = TopicNum \ Cint(Dvbbs.Board_Setting(26))+1
  			End If
			Rs.MoveFirst
			If page > n Then page = n
			If page < 1 Then page = 1
			If page > 1 Then 				
				Rs.Move (page-1) * Clng(Dvbbs.Board_Setting(26))
			End if
			SQL=Rs.GetRows(Dvbbs.Board_Setting(26))
		End If
		Set Rs=Nothing 
		TopicListToXML SQL,0
	Else
		Set Rs=Nothing 
	End If
	Dim SettingsNode,InfoNode
	Set SettingsNode = XMLDOM.documentElement.selectSingleNode("settings")
	Set InfoNode = XMLDOM.documentElement.selectSingleNode("info")
	SettingsNode.attributes.getNamedItem("alertcolor").text=Dvbbs.mainsetting(1)
	SettingsNode.attributes.getNamedItem("timestr").text=Dvbbs.Forum_Info(9)
	SettingsNode.attributes.getNamedItem("Forum_name").text=Dvbbs.Forum_Info(0)
	SettingsNode.attributes.getNamedItem("ShowNewPic").text=Dvbbs.Board_Setting(60)
	SettingsNode.attributes.getNamedItem("titleshowlen").text=Dvbbs.Board_Setting(25)
	'插入对应风格的图片路径 by Dv.ADRX
	SettingsNode.attributes.setNamedItem(XMLDOM.createNode(2,"picurl","")).text=Dvbbs.Forum_PicUrl
	InfoNode.attributes.getNamedItem("page").text=page
	InfoNode.attributes.getNamedItem("dispsize").text=Dvbbs.Board_Setting(27)
	InfoNode.attributes.getNamedItem("PageSize").text=Dvbbs.Board_Setting(26)
	InfoNode.attributes.getNamedItem("boardid").text=Dvbbs.BoardID
	InfoNode.attributes.getNamedItem("tablewidth").text=Dvbbs.mainsetting(0)
	InfoNode.attributes.getNamedItem("action").text=action
	InfoNode.attributes.getNamedItem("HotTopicChild").text=Dvbbs.Forum_Setting(44)
	InfoNode.attributes.getNamedItem("topicmode").text=TopicMode
	InfoNode.attributes.getNamedItem("topiccount").text=TopicNum
	InfoNode.attributes.getNamedItem("Forum_AllTopNum").text=Forum_AllTopNum
	InfoNode.attributes.getNamedItem("IcoLimMinute").text=Dvbbs.Board_Setting(61)
	InfoNode.attributes.getNamedItem("BoardJumpList").text="if(this.options[this.selectedIndex].value!=''){location='index.asp?boardid='+this.options[this.selectedIndex].value;}"
	If action="batch" Then
		InfoNode.attributes.getNamedItem("SelectBoardTopic").text=SelectBoardTopic
	End If
	Dim proc
	Set proc = XSLT.createProcessor()
		proc.input = XMLDOM
    	proc.transform()
    	Response.Write  proc.output
	Set XmlDom=Nothing
	Set XMLStyle=Nothing
	Set XSLT=Nothing
End Sub

Sub TopicListToXML(DataArray,MyIsTop)	
	Dim i,Node,CNode,PostTime,LastPostInfo,Expression,UseTools
	Dim Board_TopicModeStr
	If BoardTopicMode_a<>"" Then
		Board_TopicModeStr = Split(BoardTopicMode_a," | ")
	End If

	For i=0 To UBound(DataArray,2)
		If Ubound(Split(DataArray(9,i),"$")) = 7 Then
			LastPostInfo = Split(Dvbbs.ChkBadWords(DataArray(9,i)),"$")
		Else
			LastPostInfo = Split(DataArray(3,i) & "$" & DataArray(0,i) & "$" & DataArray(5,i) & "$" & DataArray(3,i) & "$$" & DataArray(4,i) & "$" & DataArray(0,i) & "$" & Dvbbs.BoardID,"$")
		End If
		Expression = Split(DataArray(15,i) & "","|")
		If Dvbbs.Board_Setting(38) = "0" Then
			PostTime = Split(DataArray(9,i),"$")(2)		'最后跟帖时间
		Else
			PostTime = DataArray(5,i)		'帖子发表时间
		End If

		Set Cnode=ListNodeObject.cloneNode(True)
		Cnode.attributes.getNamedItem("title").Text=Dvbbs.ChkBadWords(DataArray(2,i)&"")
		Cnode.attributes.getNamedItem("istop").text=DataArray(11,i)
		Cnode.attributes.getNamedItem("isvote").text=DataArray(12,i)
		Cnode.attributes.getNamedItem("isbest").text=DataArray(13,i)
		Cnode.attributes.getNamedItem("locktopic").text=DataArray(14,i)
		Cnode.attributes.getNamedItem("child").text=DataArray(6,i)
		Cnode.attributes.getNamedItem("hits").text=DataArray(7,i)
		Cnode.attributes.getNamedItem("postusername").text=Dvbbs.ChkBadWords(DataArray(3,i))
		Cnode.attributes.getNamedItem("postuserid").text=DataArray(4,i)
		Cnode.attributes.getNamedItem("boardid").text=DataArray(1,i)
		Cnode.attributes.getNamedItem("TopicID").text=DataArray(0,i)
		Cnode.attributes.getNamedItem("IsSmsTopic").text=DataArray(21,i)
		Cnode.attributes.getNamedItem("dateandtime").text=DataArray(5,i)
		Cnode.attributes.getNamedItem("Expression").text=Expression(UBound(Expression))
		If UBound(Expression)>0 Then
			Cnode.attributes.getNamedItem("topicmagicface").text=Expression(0)
		End If
		Cnode.attributes.getNamedItem("TopicMode").text=DataArray(16,i)
		Cnode.attributes.getNamedItem("votetotal").text=DataArray(8,i)
		Cnode.attributes.getNamedItem("DateDiffTime").text=DateDiff("n",Posttime,Now)+Cint(Dvbbs.Forum_Setting(0))
		'专题
		If TopicMode=0 and BoardTopicMode_a <> "" Then
			If DataArray(17,i) - 1 >= 0  And Dvbbs.BoardID = DataArray(1,i) Then
				Cnode.attributes.getNamedItem("Mode").text=Board_TopicModeStr(DataArray(17,i)-1)
			End If
		End If
		Cnode.attributes.getNamedItem("LastPostUser").text=LastPostInfo(0)
		Cnode.attributes.getNamedItem("LastPostID").text=LastPostInfo(1)
		Cnode.attributes.getNamedItem("LastPostTime").text=LastPostInfo(2)
		Cnode.attributes.getNamedItem("LastPostBody").text=LastPostInfo(3)
		Cnode.attributes.getNamedItem("LastPostPic").text=LastPostInfo(4)
		Cnode.attributes.getNamedItem("LastPostUserID").text=LastPostInfo(5)
		Cnode.attributes.getNamedItem("GetMoney").text=DataArray(18,i)&""
		Cnode.attributes.getNamedItem("GetMoneyType").text=DataArray(19,i)&""
		If Dvbbs.Forum_Setting(90)="1" Then
			If DataArray(20,i) = "" or IsNull(DataArray(20,i)) Then
				UseTools = "0"
			Else
				UseTools = Split(DataArray(20,i),",")(0)
				If Not IsNumeric(UseTools) Then UseTools = 0
			End If
			Cnode.attributes.getNamedItem("UseTools").text=UseTools
		End If
		XMLDOM.documentElement.appendChild(Cnode)
		'固顶帖子数量
		If MyIsTop = 1 Then
			If TopicMode>0 Then
				If DataArray(1,i)=Dvbbs.BoardID And DataArray(17,i)=TopicMode Then Forum_AllTopNum=Forum_AllTopNum+1
			Else
				If DataArray(1,i)=Dvbbs.BoardID Then Forum_AllTopNum=Forum_AllTopNum+1
			End If
		End If
	Next
	Set Cnode=Nothing
End Sub
Sub Show_Index_Main()
	Dim TempArray
	Dvbbs.Stats=template.Strings(0)
	Dvbbs.Nav()
	GetForumTextAd(0)
	Dvbbs.ActiveOnline()
	TempArray = Split(template.html(3),"||")
	Show_Index_Top
	Show_Index_BoardList
	If Dvbbs.Forum_setting(29)="1" Then Show_Index_BirthUser()
	If Dvbbs.Forum_ads(2)="1" or Dvbbs.Forum_ads(13)="1"  Then Response.Write "<script language=""javascript"" src=""inc/Dv_Adv.js""></script>"
	Show_Index_Footer
End Sub
Sub Show_Index_Top
	Dim newsstr,TempStr,TopArray
	Dvbbs.Name="news"&Dvbbs.BoardID
	newsstr = Split(Dvbbs.Value,"|||")
	If newsstr(1)="" Or Not IsDate(newsstr(1)) Then newsstr(1)=Now()
	TempStr = template.html(0)
	TopArray = Split(template.html(2),"||")

⌨️ 快捷键说明

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