📄 cls_main.asp
字号:
IPType = m_IPType
End Property
Public Property Get IPList() '下载系统前台目录
IPList = m_IPList
End Property
Public Property Get OverDueMode()
OverDueMode = m_OverDueMode
End Property
Public Property Get DownDir()
DownDir = m_DownDir
End Property
Public Property Get LinkType()
LinkType = m_LinkType
End Property
Public Property Get isDomain() '是否启用供求系统二级域名
isDomain = m_isDomain
End Property
Public Property Get fileNameRule() '下载文件静态文件生成规则
fileNameRule = m_fileNameRule
End Property
Public Property Get fileDirRule() '静态文件生成目录
fileDirRule = m_fileDirRule
End Property
Public Property Get classSaveType() '下载栏目目录生成首页格式
classSaveType = m_classSaveType
End Property
Public Property Get fileExtName() '生成静态文件扩展名
fileExtName = m_fileExtName
End Property
Public Property Get indexPage() '首页文件名及扩展名
indexPage = m_indexPage
End Property
Public Property Get newsCheck() '发布的下载是否需要审核
newsCheck = m_newsCheck
End Property
'获得今日下载数量
Public Function GetTodayNewsCount(f_classID)
Dim f_obj_cnews_rs
Set f_obj_cnews_rs = server.CreateObject(G_FS_RS)
If G_IS_SQL_DB=0 Then
f_obj_cnews_rs.Open "Select ID from FS_DS_List where ClassID='"& NoSqlHack(f_classID) &"' and datevalue(addtime)=#"&date()&"#",Conn,1,1
Else
f_obj_cnews_rs.Open "Select ID from FS_DS_List where ClassID='"& NoSqlHack(f_classID) &"' and convert(varchar(10),addTime,120)='"&date()&"'",Conn,1,1
End If
GetTodayNewsCount = "<span class=""tx"">"&f_obj_cnews_rs.recordcount&"</span>)"
f_obj_cnews_rs.close
set f_obj_cnews_rs = nothing
End Function
'获得用户文件名
Public Function strFileNameRule(str,f_idTF,f_id)
strFileNameRule = ""
Dim f_strFileNamearr,f_str0,f_str1,f_str2,f_str3,f_str4,Getstr,f_str5,f_str6
f_strFileNamearr = split(str,"$")
f_str0 = f_strFileNamearr(0)
f_str1 = f_strFileNamearr(1)
f_str2 = f_strFileNamearr(2)
f_str3 = f_strFileNamearr(3)
f_str4 = f_strFileNamearr(4)
f_str5 = f_strFileNamearr(5)
f_str6 = f_strFileNamearr(6)
strFileNameRule = strFileNameRule & f_strFileNamearr(0)
If Instr(1,f_strFileNamearr(1),"Y",1)<>0 then
if Len(Trim(Cstr(f_strFileNamearr(4))))<>0 then
strFileNameRule = strFileNameRule & right(year(now),2)&f_strFileNamearr(4)
Else
strFileNameRule = strFileNameRule & right(year(now),2)
End if
End if
If Instr(1,f_strFileNamearr(1),"M",1)<>0 then
if Len(Trim(Cstr(f_strFileNamearr(4))))<>0 then
strFileNameRule = strFileNameRule & month(now)&f_strFileNamearr(4)
Else
strFileNameRule = strFileNameRule& month(now)
End if
End if
If Instr(1,f_strFileNamearr(1),"D",1)<>0 then
if Len(Trim(Cstr(f_strFileNamearr(4))))<>0 then
strFileNameRule = strFileNameRule & day(now)&f_strFileNamearr(4)
Else
strFileNameRule = strFileNameRule& day(now)
End if
End if
If Instr(1,f_strFileNamearr(1),"H",1)<>0 then
if Len(Trim(Cstr(f_strFileNamearr(4))))<>0 then
strFileNameRule = strFileNameRule & hour(now)&f_strFileNamearr(4)
Else
strFileNameRule = strFileNameRule& hour(now)
End if
End if
If Instr(1,f_strFileNamearr(1),"I",1)<>0 then
if Len(Trim(Cstr(f_strFileNamearr(4))))<>0 then
strFileNameRule = strFileNameRule & minute(now)&f_strFileNamearr(4)
Else
strFileNameRule = strFileNameRule& minute(now)
End if
End if
If Instr(1,f_strFileNamearr(1),"S",1)<>0 then
if Len(Trim(Cstr(f_strFileNamearr(4))))<>0 then
strFileNameRule = strFileNameRule & second(now)&f_strFileNamearr(4)
Else
strFileNameRule = strFileNameRule& second(now)
End if
End if
Randomize
Dim f_Randchar,f_Randchararr,f_RandLen,f_iR,f_Randomizecode
f_Randchar="0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
f_Randchararr=split(f_Randchar,",")
If f_strFileNamearr(2)="2" then
if f_strFileNamearr(3)="1" then
f_RandLen=2
for f_iR=1 to f_RandLen
f_Randomizecode=f_Randomizecode&f_Randchararr(Int((21*Rnd)))
next
strFileNameRule = strFileNameRule & f_Randomizecode
Else
strFileNameRule = strFileNameRule & CStr(Int((99 * Rnd) + 1))
End if
Elseif f_strFileNamearr(2)="3" then
if f_strFileNamearr(3)="1" then
f_RandLen=3
for f_iR=1 to f_RandLen
f_Randomizecode=f_Randomizecode&f_Randchararr(Int((21*Rnd)))
next
strFileNameRule = strFileNameRule & f_Randomizecode
Else
strFileNameRule = strFileNameRule & CStr(Int((999* Rnd) + 1))
End if
Elseif f_strFileNamearr(2)="4" then
if f_strFileNamearr(3)="1" then
f_RandLen=4
for f_iR=1 to f_RandLen
f_Randomizecode=f_Randomizecode&f_Randchararr(Int((21*Rnd)))
next
strFileNameRule = strFileNameRule & f_Randomizecode
Else
strFileNameRule = strFileNameRule & CStr(Int((9999* Rnd) + 1))
End if
Elseif f_strFileNamearr(2)="5" then
if f_strFileNamearr(3)="1" then
f_RandLen=5
for f_iR=1 to f_RandLen
f_Randomizecode=f_Randomizecode&f_Randchararr(Int((21*Rnd)))
next
strFileNameRule = strFileNameRule & f_Randomizecode
Else
strFileNameRule = strFileNameRule & CStr(Int((99999* Rnd) + 1))
End if
End if
if f_strFileNamearr(5) = "1" then
strFileNameRule = strFileNameRule&f_strFileNamearr(4)&"自动编号ID"
End if
if f_strFileNamearr(6) = "1" then
strFileNameRule = strFileNameRule&f_strFileNamearr(4)&"唯一NewsID"
End if
strFileNameRule = strFileNameRule
End Function
'得到下载关键字下拉菜单
Public Function GetKeywordslist(f_char,f_number)
GetKeywordslist = ""
dim f_obj_kw_Rs
Set f_obj_kw_Rs = server.CreateObject(G_FS_RS)
f_obj_kw_Rs.Open "Select top 5 GID,G_Name,G_Type,isLock from FS_NS_General where G_Type ="& NoSqlHack(f_number) &" and isLock=0 order by GID desc",Conn,1,1
do while Not f_obj_kw_Rs.eof
if f_char = f_obj_kw_Rs("G_Name") then
GetKeywordslist = GetKeywordslist & "<option value="""& f_obj_kw_Rs("G_Name")&""" selected>"& f_obj_kw_Rs("G_Name")&"</option>"
Else
GetKeywordslist = GetKeywordslist & "<option value="""& f_obj_kw_Rs("G_Name")&""">"& f_obj_kw_Rs("G_Name")&"</option>"
End if
f_obj_kw_Rs.movenext
Loop
GetKeywordslist = GetKeywordslist
f_obj_kw_Rs.close:set f_obj_kw_Rs = nothing
End Function
'得到栏目自定义ID
Public Function GetCustClassID(f_custclassid)
Dim obj_cust_rs
set obj_cust_rs = Conn.execute("select DefineID from FS_DS_Class where Classid='"& NoSqlHack(f_custclassid) &"'")
if not obj_cust_rs.eof then
GetCustClassID = obj_cust_rs("DefineID")
Else
GetCustClassID = ""
End if
obj_cust_rs.close:set obj_cust_rs =nothing
End Function
'得到下载保存路径
Public Function SaveNewsPath(f_num)
SaveNewsPath = ""
Select Case f_num
Case 0
SaveNewsPath = "/" & year(now)&"-"&month(now)&"-"&day(now)
Case 1
SaveNewsPath = "/" & year(now)&"/"&month(now)&"/"&day(now)
Case 2
SaveNewsPath = "/" & year(now)&"/"&month(now)&"-"&day(now)
Case 3
SaveNewsPath = "/" & year(now)&"-"&month(now)&"/"&day(now)
Case 4
SaveNewsPath = "/"
Case 5
SaveNewsPath = "/" & year(now)&"/"&month(now)
Case 6
SaveNewsPath = "/" & year(now)&"/"&month(now)&day(now)
Case 7
SaveNewsPath = "/" & year(now)&month(now)&day(now)
End Select
End Function
'取得用户名
Public Function GetUserName(f_strNumber)
Dim RsGetUserName
Set RsGetUserName = User_Conn.Execute("Select UserName From FS_ME_Users Where UserNumber = '"& NoSqlHack(f_strNumber) &"'")
If Not RsGetUserName.eof Then
GetUserName = RsGetUserName("UserName")
Else
GetUserName = 0
End If
set RsGetUserName = nothing
End Function
'转移下载到其他目录
Public Function MoveNewsToClass(SourceNewsArray,ObjectClassID)
Dim i,j,RsNewsObj,CopyNewsObj,SqlNews,FiledObj
Dim NewsFileNames,TempNewsID,ConfigInfo
ConfigInfo = Conn.Execute("Select FileExtName from FS_DS_Class")(0)
for i = LBound(SourceNewsArray) to UBound(SourceNewsArray)
Set RsNewsObj = Conn.Execute("Select * from FS_News where NewsID='" & NoSqlHack(SourceNewsArray(i)) & "'")
SqlNews = "Select * from FS_News where 1=0"
Set CopyNewsObj = Server.CreateObject(G_FS_RS)
CopyNewsObj.Open SqlNews,Conn,1,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") = NoSqlHack(TempNewsID)
elseif LCase(FiledObj.name) = "classid" then
CopyNewsObj("classid") = NoSqlHack(ObjectClassID)
else
CopyNewsObj(FiledObj.name) = RsNewsObj(FiledObj.name)
end if
end if
Next
CopyNewsObj.UpDate
'NewsFileNames=NewsFileName(ConfigArray(19),ObjectClassID,TempNewsID,CopyNewsObj("ID"))
CopyNewsObj.Close
'============================
'取ID,生成文件名称,然后写回!
Conn.Execute("Update FS_News Set FileName='"&NoSqlHack(NewsFileNames)&"' Where NewsID='"&NoSqlHack(TempNewsID)&"'")
'============================
next
Set RsNewsObj = Nothing
Set CopyNewsObj = Nothing
End Function
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -