📄 cls_info(有错的).asp
字号:
end if
if SaveFilePath = "" then
ForCheckClass = ForCheckClass & "栏目的保存路径没有填写!"
end if
if FileExtName = "" then
ForCheckClass = ForCheckClass & "栏目的生成扩展名没有填写!"
end if
if ClassID = "" then
TempSqlClass = "Select ClassEName from FS_NewsClass where ClassEName='"& ClassEName & "'"
else
TempSqlClass = "Select ClassEName from FS_NewsClass where ClassEName='"& ClassEName & "' and ClassID<>'" & ClassID & "'"
end if
if Not (Conn.Execute(TempSqlClass).Eof) then
ForCheckClass = ForCheckClass & "栏目的英文名已经存在!"
end if
End Function
Public Function BatchAddClass()
Dim RsClassObj
Dim SqlClass,ErrStr,EditTF,TTempSaveFilePath,TeempFileExtName
Dim ParentID,ClassEName,ClassCName,ClassTemp,ClassID,Contribution,AddTime,SaveFilePath,FileExtName,BrowPop
Dim TempSysRootDir,ShowTF,NewsTemp,DoMain,FileTime,Orders,DownLoadTemp,ProductTemp,RedirectList
if SysRootDir = "" then
TempSysRootDir = ""
else
TempSysRootDir = "/" & SysRootDir
end If
Dim k
For k=1 To IForm("ClassNum")'开始循环获取数据库
AddTime = IForm("AddTime")
ClassID = IForm("ClassID")
ParentID = IForm("ParentID")
ClassEName = IForm("ClassEName" & k)'循环
ClassCName = IForm("ClassCName" & k)'循环
ClassTemp = IForm("ClassTemp")
NewsTemp = IForm("NewsTemp")
DownLoadTemp = IForm("DownLoadTemp")
ProductTemp = IForm("ProductTemp")
Contribution = IForm("Contribution" & k)'循环
ShowTF = IForm("ShowTF" & k)'循环
SaveFilePath = IForm("SaveFilePath")
FileExtName = IForm("FileExtName")
BrowPop = IForm("BrowPop")
DoMain = IForm("DoMain")
FileTime = IForm("FileTime" & k)'循环
Orders = IForm("Orders" & k)'循环
RedirectList = IForm("RedirectList" & k)'循环
if FileTime = "" then
FileTime = 100
else
if Not IsNumeric(FileTime) then
FileTime = 100
else
FileTime = CInt(FileTime)
end if
end if
if BrowPop <> "" then
FileExtName = "asp"
End if
ErrStr = ForCheckClass(ClassID,ParentID,ClassEName,ClassCName,ClassTemp,SaveFilePath,FileExtName)
If ErrStr <> "" then
BatchAddClass= ErrStr
Exit Function
end if
Set RsClassObj = Server.CreateObject(G_FS_RS)
SqlClass = "select * from FS_NewsClass where 1=2"
RsClassObj.Open SqlClass,Conn,1,3
RsClassObj.AddNew
RsClassObj("ClassID") = GetRandomID18()
RsClassObj("ClassEName") = NoCSSHackAdmin(ClassEName,"英文名称")
RsClassObj("ClassCName") = NoCSSHackAdmin(ClassCName,"中文名称")
RsClassObj("ParentID") = ParentID
RsClassObj("SaveFilePath") = SaveFilePath
RsClassObj("FileExtName") = FileExtName
If BrowPop <> "" then
RsClassObj("BrowPop") = CLng(BrowPop)
Else
RsClassObj("BrowPop") = 0
End if
If AddTime <> "" then
RsClassObj("AddTime") = AddTime
Else
RsClassObj("AddTime") = Now
end if
RsClassObj("ChildNum") = 0
RsClassObj("ClassTemp") = ClassTemp
RsClassObj("NewsTemp") = NewsTemp
RsClassObj("DownLoadTemp") = DownLoadTemp
If ProductTemp <> "" then
RsClassObj("ProductTemp") = ProductTemp
End if
RsClassObj("RedirectList") = RedirectList
if Contribution = "1" then
RsClassObj("Contribution") = 1
else
RsClassObj("Contribution") = 0
end if
if ShowTF = "1" then
RsClassObj("ShowTF") = 1
else
RsClassObj("ShowTF") = 0
end if
if DoMain <> "" then
RsClassObj("DoMain") = DoMain
else
RsClassObj("DoMain") = ""
end if
if Orders <> "" then
if IsNumeric(Orders) then RsClassObj("Orders") = Orders
end if
RsClassObj("FileTime") = FileTime
RsClassObj.UpDate
RsClassObj.Close
set RsClassObj=Nothing
Conn.Execute("Update FS_NewsClass Set ChildNum = ChildNum + 1 where ClassID = '" & ParentID & "'")
dim TemplRs,Lsql
set templRs= Server.CreateObject(G_FS_RS)
Lsql="select PopList from FS_admingroup where id=(select groupid from FS_admin where name='" & session("Name") & "')"
TemplRs.Open Lsql,Conn,3,3
if Not TemplRs.Eof then
TemplRs("Poplist") =TemplRs("Poplist") & "," & ClassID
TemplRs.UpDate
Session("PopedomList")=Session("PopedomList")& "," & ClassID
end if
Set TemplRs = Nothing
Next
'循环读取完毕
if err.Number = 0 then
BatchAddClass = "Success||" & ParentClassIDList(ClassID) & ClassID
Exit Function
else
BatchAddClass = "失败"
Exit Function
end If
End Function
'______________________________________________________________________
Function GetRootClassSaveFilePath(IDArrays)
Dim RsCheckObj,DoMain
Set RsCheckObj = Conn.Execute("Select ParentID,DoMain,SaveFilePath from FS_NewsClass where ClassID in ('" & Replace(IDArrays,",","','") & "')")
do while Not RsCheckObj.Eof
if RsCheckObj("ParentID") = "0" then
if (Not IsNull(RsCheckObj("DoMain"))) And (RsCheckObj("DoMain") <> "") then
GetRootClassSaveFilePath = RsCheckObj("SaveFilePath")
else
GetRootClassSaveFilePath = ""
end if
Set RsCheckObj = Nothing
Exit Function
end if
RsCheckObj.MoveNext
Loop
Set RsCheckObj = Nothing
GetRootClassSaveFilePath = ""
End Function
Public Function MoveClass(SourceClassID,ObjectClassID)
Dim RsClassObj,SqlClass,SourceClassParentID,TempArray,LoopVar
TempArray = Split(SourceClassID,"***")
for LoopVar = LBound(TempArray) to UBound(TempArray)
SqlClass = "Select ParentID,DoMain from FS_NewsClass where ClassID='" & TempArray(LoopVar) & "'"
Set RsClassObj = Conn.Execute(SqlClass)
if Not RsClassObj.Eof then
SourceClassParentID = RsClassObj("ParentID")
MoveClass = "Update FS_NewsClass Set ParentID = '" & ObjectClassID & "' where ClassID = '" & TempArray(LoopVar) & "'"
Conn.Execute(MoveClass)
MoveClass = "Update FS_NewsClass Set DoMain='' where ClassID = '" & TempArray(LoopVar) & "'"
Conn.Execute(MoveClass)
else
SourceClassParentID = ""
end if
if SourceClassParentID <> "" then
MoveClass = "Update FS_NewsClass Set ChildNum=ChildNum-1 where ClassID = '" & SourceClassParentID & "';"
Conn.Execute(MoveClass)
end if
MoveClass = "Update FS_NewsClass Set ChildNum=ChildNum+1 where ClassID = '" & ObjectClassID & "';"
Conn.Execute(MoveClass)
Next
End Function
'Class Function End
'News Function End
Public Function MoveNews(SourceNewsArray,ObjectClassID)
Dim i
for i=LBound(SourceNewsArray) to UBound(SourceNewsArray)
if SourceNewsArray(i) <> "" then
Conn.Execute("Update FS_News set ClassID='" & ObjectClassID & "' Where NewsID='" & SourceNewsArray(i) & "'")
end if
next
End Function
Public Function CopyNews(SourceNewsArray,ObjectClassID)
Dim i,j,RsNewsObj,CopyNewsObj,SqlNews,FiledObj
Dim NewsFileNames,TempNewsID,ConfigInfo
ConfigInfo = GetConfig(16)
for i = UBound(SourceNewsArray) to LBound(SourceNewsArray) Step -1
Set RsNewsObj = Conn.Execute("Select * from FS_News where NewsID='" & SourceNewsArray(i) & "'")
SqlNews = "Select * from FS_News where 1=0"
Set CopyNewsObj = Server.CreateObject(G_FS_RS)
CopyNewsObj.Open SqlNews,Conn,3,3
CopyNewsObj.AddNew
For Each FiledObj In CopyNewsObj.Fields
if LCase(FiledObj.name) <> "id" then
if LCase(FiledObj.name) = "newsid" then
TempNewsID = GetRandomID18()
CopyNewsObj("newsid") = TempNewsID
elseif LCase(FiledObj.name) = "classid" then
CopyNewsObj("classid") = ObjectClassID
elseif LCase(FiledObj.name) = "filename" then
NewsFileNames = NewsFileName(ConfigInfo,ObjectClassID,TempNewsID)
CopyNewsObj("FileName") = NewsFileNames
else
CopyNewsObj(FiledObj.name) = RsNewsObj(FiledObj.name)
end if
end if
Next
CopyNewsObj.UpDate
CopyNewsObj.Close
next
Set RsNewsObj = Nothing
Set CopyNewsObj = Nothing
End Function
'DownLoad Function End
Public Function MoveDownLoad(SourceNewsArray,ObjectClassID)
Dim i
for i=LBound(SourceNewsArray) to UBound(SourceNewsArray)
if SourceNewsArray(i) <> "" then
Conn.Execute("Update FS_DownLoad set ClassID='" & ObjectClassID & "' Where DownLoadID='" & SourceNewsArray(i) & "'")
end if
next
End Function
Public Function CopyDownLoad(SourceNewsArray,ObjectClassID)
Dim i,j,RsNewsObj,CopyNewsObj,SqlNews,FiledObj
Dim NewsFileNames,TempNewsID,ConfigInfo
Dim RsDownloadAddressS,RsDownloadAddressT,DownloadAddNum,DownName(50),DownUrl(50),DownNumber(50),Tempi
ConfigInfo = GetConfig(16)
for i = LBound(SourceNewsArray) to UBound(SourceNewsArray)
Set RsNewsObj = Conn.Execute("Select * from FS_DownLoad where DownLoadID='" & SourceNewsArray(i) & "'")
SqlNews = "Select * from FS_DownLoad where 1=0"
Set CopyNewsObj = Server.CreateObject(G_FS_RS)
CopyNewsObj.Open SqlNews,Conn,3,3
CopyNewsObj.AddNew
For Each FiledObj In CopyNewsObj.Fields
if LCase(FiledObj.name) <> "id" then
if LCase(FiledObj.name) = "downloadid" then
TempNewsID = GetRandomID18()
CopyNewsObj("downloadid") = TempNewsID
elseif LCase(FiledObj.name) = "classid" then
CopyNewsObj("classid") = ObjectClassID
elseif LCase(FiledObj.name) = "filename" then
NewsFileNames = NewsFileName(ConfigInfo,ObjectClassID,TempNewsID)
CopyNewsObj("FileName") = NewsFileNames
else
CopyNewsObj(FiledObj.name) = RsNewsObj(FiledObj.name)
end if
end if
Next
CopyNewsObj.UpDate
CopyNewsObj.Close
'===============================
'Conn.Execute("insert into FS_DownloadAddress(DownloadID,AddressName,Url,Number) Select '" & TempNewsID &"',AddressName,Url,Number from FS_DownloadAddress where DownloadID='" &SourceNewsArray(i) &"'")
'复制下载的时候,同时复制下载地址
Set RsDownloadAddressS = Server.CreateObject(G_FS_RS)'
RsDownloadAddressS.Open "Select * from FS_DownloadAddress where DownloadID='"&SourceNewsArray(i)&"'",Conn,1,1
DownloadAddNum=RsDownloadAddressS.recordcount
For Tempi=1 to DownloadAddNum
DownName(Tempi)=RsDownloadAddressS("AddressName")
DownUrl(Tempi)=RsDownloadAddressS("Url")
DownNumber(Tempi)=RsDownloadAddressS("Number")
RsDownloadAddressS.MoveNext
Next
RsDownloadAddressS.Close
Set RsDownloadAddressS=Nothing
Set RsDownloadAddressT = Server.CreateObject(G_FS_RS)'
RsDownloadAddressT.Open "Select * from FS_DownloadAddress where 1=2",Conn,3,3
For Tempi = 1 to DownloadAddNum
RsDownloadAddressT.AddNew
RsDownloadAddressT("ID")=GetRandomID18()
RsDownloadAddressT("DownloadID")=TempNewsID
RsDownloadAddressT("AddressName")=DownName(Tempi)
RsDownloadAddressT("Url")=DownUrl(Tempi)
RsDownloadAddressT("Number")=CLng(DownNumber(Tempi))
RsDownloadAddressT.Update
Next
RsDownloadAddressT.Close
Set RsDownloadAddressT=Nothing
'==================================
next
Set RsNewsObj = Nothing
Set CopyNewsObj = Nothing
End Function
'DownLoad Function End
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -