67.220.92.12 forum index.php,index.asp

  • Post author:
  • Post category:php


Rem 首页页面设置

Const CachePage=TrueRem 是否做页面缓存

Const CacheTime=60Rem 缓存失效时间

Const Link_Br = 8Rem 友情链接每行个数N

Const TopicMode_Br = 10Rem 帖子专题每行个数N

‘Dvbbs.ShowSQL = 1

Dim action

Dim XmlDom,Node,BoardList,Xpath,Count,ChildLen,BWidth

Dim AnnouncementsItem,BBSItem,BoardItem Rem 显示板块列表的变量

Dim SmallPaper,TopicModeList,TopicModeListImg

Dim Topic,TopTopic,TopicMode,lastpost,Page,PageCount,Cmd,Rs,SQL,list_type Rem 显示帖子列表的变量

Dim LinkDom,LinkNode,UserNode,UserMsg

Dim i,j,n,ii

Dim ShowMod,DispMode

action=Request(“action”)

Dvbbs.LoadTemplates(“index”)

‘Set XmlDom = Dvbbs.CreateXmlDoc(“Msxml2.FreeThreadedDOMDocument”& MsxmlVersion)

If not IsObject(Application(Dvbbs.CacheName&”_boardlist”)) Then LoadBoardList()

Set BoardList = Application(Dvbbs.CacheName&”_boardlist”)

Select Case action

Case “frameon” : ShowIsLeft()

Case Else

If Dvbbs.CheckStr(Request.Cookies(“geturl”))=”” And Dvbbs.forum_setting(103)=1 Then

Response.Cookies(“geturl”) = “index.asp”

Response.redirect “index.asp?action=frameon”

Else

Main()

End if

End Select

Sub Main()

If Dvbbs.BoardId>0 Then

Call RequestStr()

Call Chk_List_Err()

If 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,BoardList.documentElement.selectSingleNode(“board[@boardid='”&Dvbbs.BoardID&”‘]/@depth”).text,””,””

Call ShowBbsBoard()

Call DispToolsInfo()

Call TopicSetting()

TPL_Scan Template.Html(1)

Set TopTopic = Nothing

Set Topic = Nothing

Else

Dvbbs.Stats=template.Strings(0)

Dvbbs.Nav()

Dvbbs.ActiveOnline()

Call ShowBbsBoard()

TPL_Scan Template.Html(0)

End If

Call Ad()

End Sub

Sub ShowIsleft()

Dim RightUrl

RightUrl = Request.QueryString(“url”)

If RightUrl = “” Then

RightUrl = Dvbbs.ArchiveHtml(“index.asp”)

Else

If Request.Cookies(“geturl”)<>RightUrl Then

RightUrl = Dvbbs.ArchiveHtml(Request.Cookies(“geturl”))

End If

End If

%>

.navpoint { cursor: hand;}

body { overflow-x: hidden; overflow: hidden; height:100% }

td { font-size:12px; }

var status = 1;

function switchSysBar(){

if (1 == window.status){

window.status = 0;

document.getElementById(“switchPoint”).innerHTML = ‘
展开左栏
‘;

document.getElementById(“frmTitle”).style.display=”none”;

}

else{

window.status = 1;

document.getElementById(“switchPoint”).innerHTML = ‘
隐藏左栏
‘;

document.getElementById(“frmTitle”).style.display=”block”;

}

}


right.gif

End Sub

Sub RequestStr() Rem Request 数据

Page=Request(“Page”)

If (Not isNumeric(Page))or Page=”” Then Page=1

Page=Clng(Page)

If Page < 1 Then Page=1

If Request(“topicmode”)<>”” and IsNumeric(Request(“topicmode”)) Then

TopicMode=Cint(Request(“topicmode”))

Else

TopicMode=0

End If

list_type=Replace(Request(“list_type”),” “,””)

list_type=Split(list_type,”,”)

If UBound(list_type)<2 Then ReDim list_type(3):list_type(0)=0:list_type(1)=0:list_type(2)=0

End Sub

Sub Chk_List_Err()

If Dvbbs.Board_Setting(1)=”1″ and Dvbbs.GroupSetting(37)=”0″ Then

Dvbbs.AddErrCode(26)

ElseIf action=”batch” and Dvbbs.GroupSetting(45)<>”1″Then

Dvbbs.AddErrCode(28)

End If

Dvbbs.showerr()

End Sub

Sub Announcements() Rem 公告显示

Dvbbs.Name=”Dv_news_”&Dvbbs.boardid

If IsObject(XmlDom) Then Set XmlDom = Nothing

If(Dvbbs.ObjIsEmpty()) Then

Set Rs=Dvbbs.Execute(“Select id,boardid,title,addtime,bgs From Dv_bbsnews where Boardid=”&Dvbbs.boardid&” order by id desc”)

Set XmlDom = Dvbbs.RecordsetToxml(rs,”announcements”,””)

Dvbbs.Name = “Dv_news_”&Dvbbs.boardid

Dvbbs.Value = XmlDom.xml

Set Rs=Nothing

Else

Set XmlDom = Dvbbs.CreateXmlDoc(“Msxml2.FreeThreadedDOMDocument”& MsxmlVersion)

If Not XmlDom.LoadXml(Dvbbs.Value) Then

Set Rs=Dvbbs.Execute(“Select id,boardid,title,addtime,bgs From Dv_bbsnews where Boardid=”&Dvbbs.boardid&” order by id desc”)

Set XmlDom = Dvbbs.RecordsetToxml(rs,”announcements”,””)

Set Rs=Nothing

End If

End If

‘Response.Write Server.HtmlEncode(XmlDom.xml)

End Sub

Sub ShowBbsBoard()Rem 查询版面列表数据

If Dvbbs.BoardID=0 Then

Xpath=”board[@parentid=0]”

Else

Xpath=”board[@boardid=”& Dvbbs.Boardid&”]”

End If

If Not (BoardList.documentElement.firstchild is nothing) Then

If Not IsObject(Application(Dvbbs.CacheName &”_information_” & BoardList.documentElement.firstchild.getAttribute(“boardid”)) ) Then

Dvbbs.LoadAllBoardinformation()

End If

End If

End Sub

Sub GetBBSLink() Rem 加载友情链接

Dvbbs.name=”ForumLink”

If Dvbbs.ObjIsEmpty() Then LoadlinkList()

Set LinkDom=Dvbbs.CreateXmlDoc(“msxml2.FreeThreadedDOMDocument”& MsxmlVersion)

If Not (LinkDom.loadxml(Dvbbs.Value)) Then Set LinkDom=getlink()

End Sub

Function getlink()

Set Rs=Dvbbs.Execute(“select * From Dv_bbslink Order by islogo desc,id “)

Set getlink=Dvbbs.RecordsetToxml(rs,”link”,”bbslink”)

Set Rs=Nothing

End Function

Sub LoadlinkList()

Dim XmlDomTemp

Set Rs=Dvbbs.Execute(“select * From Dv_bbslink Order by islogo desc,id “)

Set XmlDomTemp=Dvbbs.RecordsetToxml(rs,”link”,”bbslink”)

Dvbbs.name=”ForumLink”

Dvbbs.Value=XmlDomTemp.xml

Set XmlDomTemp=Nothing

Set Rs=Nothing

End Sub

Sub Ad()Rem 浮动广告

If Dvbbs.Forum_ads(2)=”1″ or Dvbbs.Forum_ads(13)=”1″ Then

TPL_Echo “”

TPL_Echo ”

If Dvbbs.Forum_ads(2)=”1″ Then TPL_Echo Chr(9) & “move_ad(‘”&Dvbbs.Forum_ads(3)&”‘,'”&Dvbbs.Forum_ads(4)&”‘,'”&Dvbbs.Forum_ads(5)&”‘,'”&Dvbbs.Forum_ads(6)&”‘);” & vbNewLine

If Dvbbs.Forum_ads(13)=”1″ Then TPL_Echo Chr(9) & “fix_up_ad(‘”& Dvbbs.Forum_ads(8) & “‘,'” & Dvbbs.Forum_ads(10) & “‘,'” & Dvbbs.Forum_ads(11) & “‘,'” & Dvbbs.Forum_ads(9) & “‘);”& vbNewLine

TPL_Echo vbNewLine&””

End If

End Sub

Sub Forum_BirUser() Rem 查询今天过生日的用户

Dim Rs,SQL,NowMonth,NowDate,todaystr0,todaystr1,node

NowMonth=Month(Date())

NowDate=Day(Date())

If NowMonth< 10 Then

todaystr0=”0″&NowMonth

Else

todaystr0=CStr(NowMonth)

End If

If NowDate < 10 Then

todaystr0=todaystr0&”-“&”0″&NowDate

Else

todaystr0=todaystr0&”-“&NowDate

End If

todaystr1=NowMonth&”-“&NowDate

If todaystr0=todaystr1 Then

SQL=”select username,Userbirthday from [Dv_user] where Userbirthday like ‘%-“&todaystr1&”‘ Order by UserID”

Else

SQL=”select username,Userbirthday from [Dv_user] where Userbirthday like ‘%-“&todaystr1&”‘ Or Userbirthday like ‘%-“&todaystr0&”‘ Order by UserID”

End If

Set Rs=Dvbbs.Execute(SQL)

Set Application(Dvbbs.CacheName & “_biruser”)=Dvbbs.RecordsetToxml(rs,”user”,”biruser”)

Set Rs=Nothing

For Each node In Application(Dvbbs.CacheName & “_biruser”).documentElement.selectNodes(“user”)

todaystr0=Node.selectSingleNode(“@userbirthday”).text

If IsDate(todaystr0) Then

Node.setAttribute “age”,datediff(“yyyy”,todaystr0,Now())

Else

Application(Dvbbs.CacheName & “_biruser”).documentElement.removeChild(node)

End If

Next