📄 ks.rcls.asp
字号:
'参 数:JSID JSID,JSConfig JS参数
'*********************************************************************************************************
Function RefreshWordJS(JSID, JSConfig)
Dim JSConfigArr:JSConfigArr = Split(JSConfig, ",")
If UBound(JSConfigArr) = 17 Then
RefreshWordJS = KSLabel.RefreshCss(JSID, UCase(JSConfigArr(0)), JSConfigArr(1), JSConfigArr(2), JSConfigArr(3), JSConfigArr(4), JSConfigArr(5), JSConfigArr(6), JSConfigArr(7), JSConfigArr(8), JSConfigArr(9), JSConfigArr(10), JSConfigArr(11), JSConfigArr(12), JSConfigArr(13), JSConfigArr(14), JSConfigArr(15), JSConfigArr(16), JSConfigArr(17))
RefreshWordJS = Replace(RefreshWordJS, "'", """")
RefreshWordJS = "document.write('" & RefreshWordJS & "');"
Else
RefreshWordJS = "document.write('标签参数溢出!');"
End If
End Function
'*********************************************************************************************************
'函数名:RefreshPicJS
'作 用:发布图片JS
'参 数:JSID JSID,JSConfig JS参数
'*********************************************************************************************************
Function RefreshPicJS(JSID, JSConfig)
End Function
'=================================以下为相关栏目,内容页,频道首页等的刷新函数=====================================
' 修改日期 2007-5-19 开发:飞扬科技
'函数名:RefreshArticleContent
'作 用:刷新文章内容页面
'参 数:RS Recordset数据集
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Function RefreshArticleContent(RS,ChannelID)
Dim TFileContent, F_C, FilePath, FilePathAndName, FilePathAndNameTemp, Fname, FExt, TempFileContent, Content, ContentArr, TotalPage, I, N, CurrPage, PageStr, Flag
Application(KS.SiteSN & "RefreshType") = "ArticleContent"
Application(KS.SiteSN & "RefreshFolderID") = RS("Tid")
Application(KS.SiteSN & "RefreshInfoID") = RS("ID")
Application(KS.SiteSN & "ChannelID")=ChannelID
TempFileContent = LoadTemplate(RS("TemplateID"))
TempFileContent = ReplaceAllLabel(TempFileContent)
If InStr(TempFileContent, "{$GetCorrelativeArticle(") <> 0 Then
TempFileContent = Replace(TempFileContent, "{$GetCorrelativeArticle(", "[$GetCorrelativeArticle(")
Flag = True
Else
Flag = False
End If
If Flag = True Then
TFileContent = ReplaceLableFlag(ReplaceGeneralLabelContent(TempFileContent))
ElseIf (RS("TemplateID") <> Application(KS.SiteSN & "RefreshTemplateID")) Or (Trim(RS("Tid")) <> Trim(Application(KS.SiteSN & "RefreshCurrTid"))) Or Application(KS.SiteSN & "RefreshTempFileContent") = "" Then
Application(KS.SiteSN & "RefreshCurrTid") = RS("Tid")
Application(KS.SiteSN & "RefreshTemplateID") = RS("TemplateId")
Application(KS.SiteSN & "RefreshTempFileContent") = ReplaceLableFlag(ReplaceGeneralLabelContent(TempFileContent)) '替换函数标签
TFileContent = Application(KS.SiteSN & "RefreshTempFileContent")
Else
TFileContent = Application(KS.SiteSN & "RefreshTempFileContent")
End If
on error resume next
FExt = Mid(Trim(RS("Fname")), InStrRev(Trim(RS("Fname")), ".")) '分离出扩展名
Fname = Replace(Trim(RS("Fname")), FExt, "") '分离出文件名 如 2005/9-10/1254ddd
FilePathAndNameTemp =Replace(KS.Setting(3) & KS.C_S(ChannelID,8),"//","/")& KS.C_C(RS("Tid"),2)
Dim ShowUrl:ShowUrl =KS.GetFolderPath(RS("Tid"))
FilePathAndName = FilePathAndNameTemp & RS("Fname")
FilePath = Replace(FilePathAndName, Mid(FilePathAndName, InStrRev(FilePathAndName, "/")), "")
Call KS.CreateListFolder(FilePath)
Content =RS("ArticleContent")
If Content="" Then Content = " "
ContentArr = Split(Content, "[NextPage]")
TotalPage = UBound(ContentArr) + 1
For I = 0 To UBound(ContentArr)
CurrPage = I + 1
If TotalPage > 1 Then
If I = 0 Then
PageStr = "<p><div align=center><a href=" & ShowUrl & Fname & "_" & (CurrPage + 1) & FExt & ">下一页</a><br>"
ElseIf I = 1 And I <> TotalPage - 1 Then '对于最后一页刚好是第二页的要做特殊处理
PageStr = "<p><div align=center><a href=" & ShowUrl & RS("Fname") & ">上一页</a> <a href=" & ShowUrl & Fname & "_" & (CurrPage + 1) & FExt & ">下一页</a><br>"
ElseIf I = 1 And I = TotalPage - 1 Then
PageStr = "<p><div align=center><a href=" & ShowUrl & RS("Fname") & ">上一页</a><br>"
ElseIf I = TotalPage - 1 Then
PageStr = "<p><div align=center><a href=" & ShowUrl & Fname & "_" & (CurrPage - 1) & FExt & ">上一页</a><br>"
Else
PageStr = "<p><div align=center><a href=" & ShowUrl & Fname & "_" & (CurrPage - 1) & FExt & ">上一页</a> <a href=" & ShowUrl & Fname & "_" & (CurrPage + 1) & FExt & ">下一页</a><br>"
End If
PageStr = PageStr & "本文共<font color=red> " & TotalPage & " </font>页,第 "
For N = 1 To TotalPage
If N = 1 Then
If CurrPage = N Then
PageStr = PageStr & ("<font color=red>[" & N & "]</font> ")
Else
PageStr = PageStr & ("<a href=" & ShowUrl & RS("Fname") & ">[" & N & "]</a> ")
End If
Else
If CurrPage = N Then
PageStr = PageStr & ("<font color=""red"">[" & N & "]</font> ")
Else
PageStr = PageStr & ("<a href=" & ShowUrl & Fname & "_" & N & FExt & ">[" & N & "]</a> ")
End If
End If
If TotalPage > 10 Then
If N Mod 10 = 0 Then PageStr = PageStr & "<br>"
End If
Next
PageStr = PageStr & "页</div></p>"
Else
PageStr = ""
End If
If CurrPage <> 1 Then FilePathAndName = FilePathAndNameTemp & Fname & "_" & CurrPage & FExt
F_C = TFileContent
If InStr(F_C, "[$GetCorrelativeArticle(") <> 0 Then F_C = ReplaceLableFlag(Replace(F_C, "[$GetCorrelativeArticle(", "{$GetCorrelativeArticle("))
F_C = ReplaceNewsContent(ChannelID,RS, F_C, ContentArr(I) & PageStr)
F_C = ReplaceRA(F_C, Trim(KS.C_C(RS("Tid"),4)))
Call FSOSaveFile(F_C, FilePathAndName)
On Error GoTo 0
Next
End Function
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'函数名:RefreshFolder
'作 用:刷新栏目页面
'参 数:RS Recordset数据集
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Function RefreshFolder(ChannelID,RS)
Dim F_C, FolderDir, FilePath, TempFilePath,Index
Application(KS.SiteSN & "RefreshType") = "Folder"
Application(KS.SiteSN&"ChannelID") = RS("ChannelID")
Application(KS.SiteSN & "RefreshFolderID") = RS("ID")
'检查当前刷新的是否是频道(栏目)首页
If Trim(RS("TN")) = "0" Then Application(KS.SiteSN & "RefreshChannelHomeFlag") = True Else Application(KS.SiteSN & "RefreshChannelHomeFlag") = False
F_C = LoadTemplate(RS("FolderTemplateID"))
F_C = ReplaceGeneralLabelContent(F_C) '替换网站通用标签
F_C = ReplaceAllLabel(F_C)
F_C = ReplaceLableFlag(F_C) '替换函数标签
Index = RS("FolderFsoIndex")
FolderDir = KS.C_S(ChannelID,8)
If Left(FolderDir, 1) = "/" Or Left(FolderDir, 1) = "\" Then FolderDir = Right(FolderDir, Len(FolderDir) - 1)
FilePath = KS.Setting(3) & FolderDir & RS("Folder")
Call KS.CreateListFolder(FilePath)
If (Application(Cstr(KS.SiteSN & "PageList")) <> "") Then
Call GetPageStr(Application(Cstr(KS.SiteSN & "PageList")), "", Index, F_C, FilePath, Trim(RS("FolderDomain")), True)
Application.Contents.Remove (KS.SiteSN & "PageList")
Else
F_C = Replace(F_C, "{PageListStr}", "")
F_C = ReplaceRA(F_C, Trim(RS("FolderDomain")))
Call FSOSaveFile(F_C, FilePath & Index)
End If
End Function
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'函数名:RefreshSpecials
'作 用:刷新专题页面
'参 数:RS Recordset数据集
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Function RefreshSpecials(RS)
Dim F_C, SpecialDir, FilePath,Index,TempStr
'设置刷新类型,以取得当前导航位置
Application(KS.SiteSN & "RefreshType") = "Special"
Application(KS.SiteSN & "RefreshFolderID") = Trim(RS("FolderID"))
Response.Cookies(KS.SiteSN)("CurrSpecialID") = Trim(RS("SpecialID"))
Application(KS.SiteSN&"ChannelID")=RS("ChannelID")
'读出专题页对应的模板
F_C = LoadTemplate(RS("TemplateID"))
F_C = ReplaceGeneralLabelContent(F_C) '替换网站通用标签
F_C = ReplaceAllLabel(F_C)
Index = Trim(RS("FsoSpecialIndex"))
SpecialDir = KS.Setting(95)
If Left(SpecialDir, 1) = "/" Or Left(SpecialDir, 1) = "\" Then SpecialDir = Right(SpecialDir, Len(SpecialDir) - 1)
FilePath = KS.Setting(3) & SpecialDir & RS("SpecialEName") & "/"
Call KS.CreateListFolder(FilePath)
F_C = ReplaceLableFlag(F_C) '替换函数标签
F_C = ReplaceSpecialCotent(F_C,RS)
If (Application(KS.SiteSN & "PageList") <> "") Then
Call GetPageStr(Application(KS.SiteSN & "PageList"), Trim(DomainStr & SpecialDir & RS("SpecialEname") & "/"), Index, F_C, FilePath, "", True)
Application(KS.SiteSN & "PageList") = ""
Else
F_C = Replace(F_C, "{PageListStr}", "")
F_C = ReplaceRA(F_C, "")
Call FSOSaveFile(F_C, FilePath & Index)
End If
End Function
'6-1增加
Function ReplaceSpecialCotent(F_C,RS)
F_C=Replace(F_C,"{$GetSpecialName}",RS("SpecialName"))
If Not Isnull(RS("PhotoUrl")) And RS("PhotoUrl")<>"" Then
F_C=Replace(F_C,"{$GetSpecialPic}","<img src=""" & RS("PhotoUrl") & """ border=""0"">")
Else
F_C=Replace(F_C,"{$GetSpecialPic}","<img src=""" & DomainStr & "images/nophoto.gif"" border=""0"">")
End If
F_C=Replace(F_C,"{$GetSpecialNote}",RS("SpecialNote"))
F_C=Replace(F_C,"{$GetSpecialDate}",RS("SpecialAddDate"))
ReplaceSpecialCotent=F_C
End Function
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'函数名:RefreshChannelSpecials
'作 用:刷新频道专题汇总页
'参 数:RS Recordset数据集
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Function RefreshChannelSpecials(RS)
Dim F_C, SpecialDir, Index, FilePath
Application(KS.SiteSN & "RefreshType") = "ChannelSpecial" '设置刷新类型,以取得当前导航位置
Application("RefreshFolderName") = RS("FolderName") '此处存放频道名称,以取得导航位置
Application(KS.SiteSN & "RefreshFolderID") = RS("ID")
If RS("SpecialTemplateID")="" Then
RefreshChannelSpecials="请先绑定频道专题汇总模板!":exit function
Else
F_C = LoadTemplate(RS("SpecialTemplateID"))
End If
F_C = ReplaceGeneralLabelContent(F_C) '替换网站通用标签
F_C = ReplaceAllLabel(F_C)
F_C = ReplaceLableFlag(F_C) '替换函数标签
SpecialDir = KS.Setting(95)
If Left(SpecialDir, 1) = "/" Or Left(SpecialDir, 1) = "\" Then SpecialDir = Right(SpecialDir, Len(SpecialDir) - 1)
Index = RS("FolderFsoIndex")
FilePath = KS.Setting(3) & SpecialDir & RS("Folder")
Call KS.CreateListFolder(FilePath)
If (Application(Cstr(KS.SiteSN & "PageList")) <> "") Then
'调用通用分页处理过程
Call GetPageStr(Application(Cstr(KS.SiteSN & "PageList")), Trim(DomainStr & SpecialDir & RS("Folder")), Index, F_C, FilePath, "", True)
Application.Contents.Remove (KS.SiteSN & "PageList")
Else
F_C = ReplaceRA(F_C, "")
Call FSOSaveFile(F_C, FilePath & Index)
End If
End Function
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'函数名:RefreshCommonPage
'作 用:刷新通用页面
'参 数:RS Recordset数据集
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Function RefreshCommonPage(ByVal FileName,FsoFileName)
Dim F_C, CommonDir, FilePath
F_C = LoadTemplate(FileName)
F_C = ReplaceGeneralLabelContent(F_C) '替换通用标签 如{$GetWebmaster}
F_C = ReplaceLableFlag(ReplaceAllLabel(F_C)) '替换函数标签
'如果采用根相对路径,则替换绝对路径为根相对路径
F_C = ReplaceRA(F_C, "")
CommonDir = Replace(KS.Setting(94), "\", "")
If Left(CommonDir, 1) = "/" Then CommonDir = Right(CommonDir, Len(CommonDir) - 1)
'FilePath = KS.Setting(3) & CommonDir
FilePath=Replace(FsoFileName,Split(FsoFileName,"/")(Ubound(Split(FsoFileName,"/"))),"")
Call KS.CreateListFolder(KS.Setting(3) & CommonDir & FilePath)
Call FSOSaveFile(F_C, KS.Setting(3) & CommonDir & FsoFileName)
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -