📄 cls_main.asp
字号:
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 Property Get refreshFile() '系统多少分钟自动刷新首页
refreshFile = m_refreshFile
End Property
Public Property Get isOpen() '是否开通新闻发布信息
isOpen = m_isOpen
End Property
Public Property Get indexTemplet() '首页模板地址
indexTemplet = m_indexTemplet
End Property
Public Property Get isPrintPic() '是否在新闻上传的时候为图片加水印文字
isPrintPic = m_isPrintPic
End Property
Public Property Get linkType() '采用绝对路径还是相对路径
linkType = m_linkType
End Property
Public Property Get fileChar() '新闻内容过滤关键字
fileChar = m_fileChar
End Property
Public Property Get isCheck() '添加的新闻是否审核
isCheck = m_isCheck
End Property
Public Property Get isReviewCheck() '发布的新闻的评论是否要审核
isReviewCheck = m_isReviewCheck
End Property
Public Property Get reviewFiltChar() '发表评论过滤的关键字
reviewFiltChar = m_reviewFiltChar
End Property
Public Property Get isConstrCheck() '投稿是否需要审核后才能发布
isConstrCheck = m_isConstrCheck
End Property
Public Property Get addNewsType() '添加新闻采用的方式
addNewsType = m_addNewsType
End Property
Public Property Get allInfotitle() '所有新闻系统站点及全站
allInfotitle = m_allInfotitle
End Property
public Property get reycleTF()
reycleTF = m_reycleTF
End Property
'RSS调用参数
public Property get RSSTF()
RSSTF = m_RSSTF
End Property
public Property get rssNumber()
rssNumber = m_rssNumber
End Property
public Property get rssdescript()
rssdescript = m_rssdescript
End Property
public Property get RSSPIC()
RSSPIC = m_RSSPIC
End Property
public Property get rssContentNumber()
rssContentNumber = m_rssContentNumber
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_NS_News where ClassID='"& NoSqlHack(f_classID) &"' and datevalue(addtime)=#"&date()&"#",Conn,1,1
Else
f_obj_cnews_rs.Open "Select ID from FS_NS_News where ClassID='"& NoSqlHack(f_classID) &"' and datevalue(addtime)='"&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_NS_NewsClass 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_NewsClass")(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 + -