📄 job_clsmain.asp
字号:
For i=0 to UBound(lastpost)
Application(CacheName &"_information_" & bid).documentElement.selectSingleNode("information/@lastpost_"& i &"").text=lastpost(i)
If i = 7 Then Exit For
Next
Rs.Close
Set Rs= Nothing
End Sub
Public Sub LoadGroupSetting()
Dim Rs
Set Rs=FRHRcms.Execute("Select GroupSetting,UserGroupID,ParentGID,IsSetting,UserTitle From Dv_UserGroups")
Set Application(CacheName &"_groupsetting")=RecordsetToxml(rs,"usergroup","")
Set Rs=FRHRcms.Execute("Select UserGroupID,usertitle,titlepic,orders From Dv_UserGroups order by orders")
Set Application(CacheName &"_grouppic")=RecordsetToxml(rs,"usergroup","grouppic")
Set Rs=Nothing
End Sub
Public Sub Loadstyle()
Dim Rs
Set Rs=FRHRcms.Execute("Select * From Dv_style")
Set Application(CacheName &"_style")=RecordsetToxml(rs,"style","")
Set Rs=Nothing
LoadStyleMenu()
End Sub
Public Sub LoadStyleMenu()'生成风格选单数据
Name="style_list"
Dim XMLDom,stylesheet,XMLStyle,proc
Set XMLDom=Application(CacheName &"_style").cloneNode(True)
XMLDom.documentElement.appendChild(Application(CacheName & "_csslist").documentElement.cloneNode(True))
Set XMLStyle=Server.CreateObject("msxml2.XSLTemplate" & MsxmlVersion)
Set stylesheet=Server.CreateObject("msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
stylesheet.load Server.MapPath(MyDbPath &"inc\Templates\stylemenu.xslt")
XMLStyle.stylesheet=stylesheet
Set proc=XMLStyle.createProcessor()
proc.input = XMLDom
proc.transform()
value=proc.output
End Sub
Public Sub UpdateForum_Info(act)'act=0 不处理缓存,act=1 处理缓存
If value <> "1900-1-1" Then
value="1900-1-1"
Dim Rs,LastPostInfo,TempStr,i,Board
Dim Forum_YesterdayNum,Forum_TodayNum,Forum_LastPost,Forum_MaxPostNum,Forum_MaxPostDate
Set Rs=Execute("Select Top 1 Forum_YesterdayNum,Forum_TodayNum,Forum_LastPost,Forum_MaxPostNum From Dv_Setup")
Forum_YesterdayNum=Rs(0)
Forum_TodayNum=Rs(1)
Forum_LastPost=Rs(2)
Forum_MaxPostNum=Rs(3)
Set Rs=Nothing
LastPostInfo = Split(Forum_LastPost,"$")
If Not IsDate(LastPostInfo(2)) Then LastPostInfo(2)=Now()
If DateDiff("d",CDate(LastPostInfo(2)),Now())<>0 Then'最后发帖时间不是今天,
TempStr=LastPostInfo(0)&"$"&LastPostInfo(1)&"$"&Now()&"$"&LastPostInfo(3)&"$"&LastPostInfo(4)&"$"&LastPostInfo(5)&"$"&LastPostInfo(6)&"$"&LastPostInfo(7)
Execute("Update Dv_Setup Set Forum_YesterdayNum="&Forum_TodayNum&",Forum_LastPost='"&TempStr&"',Forum_TodayNum=0")
Execute("update Dv_board Set TodayNum=0")
If act=1 Then
If not IsObject(Application(CacheName&"_boardlist")) Then LoadBoardList()
For Each board in Application(CacheName&"_boardlist").documentElement.selectNodes("board/@boardid")
LoadBoardinformation board.text
Next
End If
End If
If Forum_TodayNum >Forum_MaxPostNum Then
Execute("Update Dv_Setup Set Forum_MaxPostNum=Forum_TodayNum,Forum_MaxPostDate="&SqlNowString)
End If
If act=1 Then loadSetup()
Dim xmlhttp
If IsSqlDataBase =0 Then
On Error Resume Next
Set xmlhttp = Server.CreateObject("msxml2.ServerXMLHTTP")
xmlhttp.setTimeouts 65000, 65000, 65000, 65000
xmlhttp.Open "POST",Get_ScriptNameUrl& "Loadservoces.asp",false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send()
Set xmlhttp = Nothing
End If
End If
Name="Date"
value=Date()
End Sub
Public Sub GetForum_Setting()
Name="Date"
If ObjIsEmpty() Then
UpdateForum_Info(0)
ElseIf Cstr(value) <> Cstr(Date()) Then
UpdateForum_Info(1)
End If
Name="setup"
If ObjIsEmpty Then loadSetup()
If Not IsObject(Application(CacheName&"_boardlist")) Then
LoadBoardList()
End If
If Not IsObject(Application(CacheName &"_style")) Then
Loadstyle()
End If
Name="setup"
CacheData=value
Dim Setting,OpenTime,ischeck:Setting= Split(CacheData(1,0),"|||"):Forum_Info = Split (Setting(0),",")
Forum_Setting = Split (Setting(1),","):Forum_UploadSetting = Split(Forum_Setting(7),"|")
Forum_user = Setting(2):Forum_user = Split (Forum_user,","):Forum_Copyright = Setting(3)
Forum_ChanSetting = Split(CacheData(24,0),","): Forum_Version = CacheData(18,0):BadWords = Split(CacheData(3,0),"|")
rBadWord = Split(CacheData(4,0),"|"): Main_Sid=CacheData(17,0):Maxonline = CacheData(5,0):NowUseBBS = CacheData(19,0):Cookiepath = CacheData(26,0)
If ScriptFolder = Lcase(CacheData(33,0)) Then Page_Admin = True
Rem 禁止代理服务器访问开始,如需要允许访问,请屏蔽此段代码。
If Forum_Setting(100)="1" Then
If actforip <> "" Then
Session(CacheName & "UserID")=empty
Set FRHRcms=Nothing
Response.Status = "302 Object Moved"
Response.End
End If
If UBound(Forum_Setting)> 101 Then
IP_MAX=CLng(Forum_Setting(101))
Else
IP_MAX=0
End If
End If
Rem 禁止代理服务器访问结束
If Forum_Setting(21)="1" And Not Page_Admin Then Set FRHRcms=Nothing:Response.redirect "showerr.asp?action=stop"
If BoardID <>0 Then
If Application(CacheName&"_boardlist").documentElement.selectSingleNode("board[@boardid='"&BoardID&"']") Is Nothing Then
Set FRHRcms=Nothing
Response.Write "错误的版面参数"
Response.End
End If
End If
If BoardID > 0 Then
If Not IsObject(Application(CacheName &"_boarddata_" & Boardid)) Then LoadBoardData boardid
If Not IsObject (Application(CacheName &"_information_" & boardid)) Then LoadBoardinformation BoardID
Dim Nodelist,node
Forum_ads = Split(Application(CacheName &"_boarddata_" & Boardid).documentElement.selectSingleNode("boarddata/@board_ads").text,"$")
Forum_user = Split(Application(CacheName &"_boarddata_" & Boardid).documentElement.selectSingleNode("boarddata/@board_user").text,",")
board_Setting = Split(Application(CacheName &"_boarddata_" & Boardid).documentElement.selectSingleNode("boarddata/@board_setting").text,",")
BoardType = Application(CacheName&"_boardlist").documentElement.selectSingleNode("board[@boardid='"&BoardID&"']/@boardtype").text
BoardRootID = Application(CacheName &"_boarddata_" & Boardid).documentElement.selectSingleNode("boarddata/@rootid").text
BoardParentID=CLng(Application(CacheName&"_boardlist").documentElement.selectSingleNode("board[@boardid='"&BoardID&"']/@parentid").text)
Sid = Application(CacheName &"_boarddata_" & Boardid).documentElement.selectSingleNode("boarddata/@sid").text
Boardreadme=Application(CacheName&"_boardlist").documentElement.selectSingleNode("board[@boardid='"&BoardID&"']/@readme").text
If Len(Board_Setting(22))< 24 Then Board_Setting(22)="1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1"
OpenTime=Split(Board_Setting(22),"|")
setting=Board_Setting(21)
ischeck=Clng(Board_Setting(18))
If Board_Setting(50)<>"0" And Board_Setting(50)<>"" Then
tourl=Board_Setting(50)
Set FRHRcms=Nothing
Response.Redirect tourl
End If
Else
Forum_ads = Split(CacheData(2,0),"$")
If Len(Forum_Setting(70))< 24 Then Forum_Setting(70)="1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1"
OpenTime=Split(Forum_Setting(70),"|")
setting=Forum_Setting(69)
ischeck=Forum_Setting(26)
If Not IsNumeric(ischeck) Then ischeck=0
ischeck=CLng(ischeck)
End If
'定时开放判断
If Not Page_Admin And Cint(setting)=1 Then
If OpenTime(Hour(Now))="1" Then
tourl="showerr.asp?action=stop&boardid="&FRHRcms.BoardID&""
Set FRHRcms=Nothing:
Set FRHRcms=Nothing:Response.Redirect tourl
End If
End If
'在线人数限制
If ischeck > 0 And Not Page_Admin Then
If MyBoardOnline.Forum_Online > ischeck And BoardID=0 Then
tourl="showerr.asp?action=limitedonline&lnum="&ischeck
If Not IsONline(Membername,1) Then Set FRHRcms=Nothing:Response.Redirect tourl
End If
If BoardID > 0 Then
tourl="showerr.asp?action=limitedonline&lnum="&ischeck
If (Not IsONline(Membername,1)) And MyBoardOnline.Board_Online > ischeck Then Set FRHRcms=Nothing:Response.Redirect tourl
End If
End If
Dim CookiesSid
CookiesSid = Request.Cookies("skin")("skinid_"&BoardID)
If InStr(CookiesSid,"_")=0 Or CookiesSid = "" Then
If BoardID = 0 Then
SkinID = Main_Sid
CssID=CacheData(30,0)
Else
SkinID = Sid
CssID=Application(CacheName &"_boarddata_" & Boardid).documentElement.selectSingleNode("boarddata/@cid").text
End If
Else
CookiesSid=Split(CookiesSid,"_")
CssID=CookiesSid(1)
SkinID=CookiesSid(0)
End If
Setting=empty
End Sub
Public Function IsReadonly()
IsReadonly=False
Dim TimeSetting
If Forum_Setting(69)="2" Then
TimeSetting=split(Forum_Setting(70),"|")
If TimeSetting(Hour(Now))="1" Then
IsReadonly=True
Exit Function
End If
End If
If BoardID>0 Then
If Board_Setting(21)="2" Then
TimeSetting=split(Board_Setting(22),"|")
If TimeSetting(Hour(Now))="1" Then IsReadonly=True
End If
End If
End Function
Public Function IsONline(UserName,action)
IsONline=False
If Trim(UserName)="" Then Exit Function
If IsObject(Session(CacheName & "UserID")) And action=1 Then
IsONline=True:Exit Function
End If
Dim Rs
Set Rs =Execute("Select UserID From Dv_Online Where Username='"&UserName&"'")
If Not Rs.EOF Then IsONline=True
Set rs=Nothing
End Function
Public Sub LoadTemplates(Page_Fields)
Dim Style_Pic,Main_Style,TempStyle,cssfilepath
If Application(CacheName &"_style").documentElement.selectSingleNode("style[@id='"& SkinID &"']") Is Nothing Then
If Not Application(CacheName &"_style").documentElement.selectSingleNode("style/@id") Is Nothing Then
SkinID=Application(CacheName &"_style").documentElement.selectSingleNode("style/@id").text
Else
Set FRHRcms=Nothing
Response.Write "模板数据无法提取,请检查模板数据"
Response.End
End If
End If
Dim hascss
If Application(CacheName & "_csslist").documentElement.selectSingleNode("css[@id='"& CssID &"' and tid='"& SkinID &"']") Is Nothing Then
If Not Application(CacheName & "_csslist").documentElement.selectSingleNode("css[tid='"& SkinID &"']/@id") Is Nothing Then
CssID=Application(CacheName & "_csslist").documentElement.selectSingleNode("css[tid='"& SkinID &"']/@id").text
hascss=true
ElseIf Not Application(CacheName & "_csslist").documentElement.selectSingleNode("css/@id") Is Nothing Then
CssID=Application(CacheName & "_csslist").documentElement.selectSingleNode("css/@id").text
cssfilepath=Application(CacheName & "_csslist").documentElement.selectSingleNode("@cssfilepath").text
Forum_PicUrl=cssfilepath & Application(CacheName & "_csslist").documentElement.selectSingleNode("css[@id='"& CssID &"']/@picurl").text
Else
SkinID=Application(CacheName &"_style").documentElement.selectSingleNode("style/@id").text
If Not Application(CacheName & "_csslist").documentElement.selectSingleNode("css[tid='"& SkinID &"']/@id") Is Nothing Then
CssID=Application(CacheName & "_csslist").documentElement.selectSingleNode("css[tid='"& SkinID &"']/@id").text
hascss=true
Else
CssID=Application(CacheName & "_csslist").documentElement.selectSingleNode("css/@id").text
hascss=true
End If
End If
Else
hascss=true
End If
If hascss Then
cssfilepath=Application(CacheName & "_csslist").documentElement.selectSingleNode("@cssfilepath").text
Forum_PicUrl=cssfilepath & Application(CacheName & "_csslist").documentElement.selectSingleNode("css[@id='"& CssID &"' and tid='"& SkinID &"']/@picurl").text
StyleName=Application(CacheName &"_style").documentElement.selectSingleNode("style[@id='"& SkinID &"']/@stylename").text
End If
Main_Style = Replace(Application(CacheName &"_style").documentElement.selectSingleNode("style[@id='"& SkinID &"']/@main_style").text,"{$PicUrl}",Forum_PicUrl) '风格图片路径替换
If Not (Instr(ScriptName,"index")>0 Or Page_Admin) Then
Style_Pic = Replace(Application(CacheName &"_style").documentElement.selectSingleNode("style[@id='"& SkinID &"']/@style_pic").text,"{$PicUrl}",Forum_PicUrl) '风格图片路径替换
Style_Pic = Split(Style_Pic,"@@@")
Forum_UserFace = Style_Pic(0)
Forum_PostFace = Style_Pic(1)
Forum_Emot = Style_Pic(2)
End If
If Page_Fields<>"" Then
Template.value =Application(CacheName &"_style").documentElement.selectSingleNode("style[@id='"& SkinID &"']/@page_"& LCase(Page_Fields)).text
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -