📄 down_add.asp
字号:
DownFsoType = KSCMS.G("DownFsoType"):If DownFsoType = "" Then DownFsoType = 1
If Action = "Add" OR Action="Verify" Then '取得生成文件名
Fname = KSCMS.GetFileName(DownFsoType, AddDate, FnameType)
End If
If Title = "" Then
.Write ("<script>alert('下载名称不能为空!');history.back(-1);</script>")
End If
Set DownRS = Server.CreateObject("ADODB.RecordSet")
If Tid = "" Then ErrMsg = ErrMsg & "[下载类别]必选! \n"
If Title = "" Then ErrMsg = ErrMsg & "[下载标题]不能为空! \n"
If Title <> "" And Tid <> "" And Action = "Add" Then
SQLStr = "select * from KS_DownLoad where Title='" & Title & "' And Tid='" & Tid & "'"
DownRS.Open SQLStr, conn, 1, 1
If Not DownRS.EOF Then
ErrMsg = ErrMsg & "该类别已存在此项下载! \n"
End If
DownRS.Close
End If
If ErrMsg <> "" Then
.Write ("<script>alert('" & ErrMsg & "');history.back(-1);</script>")
.End
Else
If Action = "Add" Or Action="Verify" Then
SQLStr = "select * from KS_DownLoad where DownID=null"
DownRS.Open SQLStr, conn, 1, 3
DownRS.AddNew
'生成下载ID
DownRS("DownID") = DownID
DownRS("Title") = Title
DownRS("DownVerSion") = DownVerSion
DownRS("DownLB") = DownLb
DownRS("DownYY") = DownYY
DownRS("DownSQ") = DownSQ
DownRS("DownPT") = DownPT
DownRS("DownSize") = DownSize
DownRS("YSDZ") = YSDZ
DownRS("ZCDZ") = ZCDZ
DownRS("JYMM") = JYMM
DownRS("PhotoUrl") = PhotoUrl
DownRS("BigPhoto") = BigPhoto
DownRS("DownContent") = KSCMS.ReplaceInnerLink(DownContent)
DownRS("FlagUrl") = FlagUrl
DownRS("DownUrls") = DownUrls
DownRS("Recommend") = Recommend
DownRS("Popular") = Popular
DownRS("Verific") = Verific
DownRS("Comment") = Comment
DownRS("Tid") = Tid
DownRS("KeyWords") = KeyWords
DownRS("Author") = Author
DownRS("Origin") = Origin
DownRS("AddDate") = AddDate
DownRS("Rank") = Rank
'DownRS("Slide") = Slide
DownRS("TemplateID") = TemplateID
DownRS("Hits") = Hits
DownRS("HitsByDay") = HitsByDay
DownRS("HitsByWeek") = HitsByWeek
DownRS("HitsByMonth") = HitsByMonth
DownRS("DownFsoType") = DownFsoType
DownRS("Fname") = Fname
if Action="Verify" Then
DownRS("DownInput") = Trim(KSCMS.G("DownInput"))
Else
DownRS("DownInput") = Trim(Session("Name"))
End IF
DownRS("RefreshTF") = Makehtml
DownRS("DelTF") = 0
DownRS("OrderID") = 1
DownRS.Update
'写入Session,添加下一篇下载调用
Session("KeyWords") = KeyWords
Session("Author") = Author
Session("Origin") = Origin
Call RefreshHtml(2)
DownRS.Close:Set DownRS = Nothing
ElseIf Action = "Edit" Then
DownID = Trim(Request("DownID"))
SQLStr = "SELECT * FROM KS_DownLoad Where DownID='" & DownID & "'"
DownRS.Open SQLStr, conn, 1, 3
If DownRS.EOF And DownRS.BOF Then
.Write ("<script>alert('参数传递出错!');history.back(-1);</script>")
.End
End If
DownRS("Title") = Title
DownRS("DownVerSion") = DownVerSion
DownRS("DownLB") = DownLb
DownRS("DownYY") = DownYY
DownRS("DownSQ") = DownSQ
DownRS("DownPT") = DownPT
DownRS("DownSize") = DownSize
DownRS("YSDZ") = YSDZ
DownRS("ZCDZ") = ZCDZ
DownRS("JYMM") = JYMM
DownRS("FlagUrl") = FlagUrl
DownRS("PhotoUrl") = PhotoUrl
DownRS("BigPhoto") = BigPhoto
DownRS("DownContent") = DownContent
DownRS("DownUrls") = DownUrls
DownRS("Recommend") = Recommend
DownRS("Popular") = Popular
DownRS("Verific") = Verific
DownRS("Comment") = Comment
DownRS("Tid") = Tid
DownRS("KeyWords") = KeyWords
DownRS("Author") = Author
DownRS("Origin") = Origin
DownRS("AddDate") = AddDate
DownRS("Rank") = Rank
'DownRS("Slide") = Slide
DownRS("TemplateID") = TemplateID
DownRS("Fname") = Replace(DownRS("Fname"), Trim(Mid(Trim(DownRS("Fname")), InStrRev(Trim(DownRS("Fname")), "."))), FnameType)
If Makehtml = 1 Then
DownRS("RefreshTF") = 1
End If
DownRS("Hits") = Hits
DownRS("HitsByDay") = HitsByDay
DownRS("HitsByWeek") = HitsByWeek
DownRS("HitsByMonth") = HitsByMonth
DownRS("DownFsoType") = DownFsoType
DownRS.Update
Call RefreshHtml(2)
DownRS.Close:Set DownRS = Nothing
If KeyWord <> "" Then
.Write ("<script> parent.frames['MainFrame'].focus();alert('下载修改成功!');location.href='Down_main.asp?DisplayMode=" & DisplayMode & "&Page=" & Page & "&KeyWord=" & KeyWord & "&SearchType=" & SearchType & "&StartDate=" & StartDate & "&EndDate=" & EndDate & "';parent.frames['BottomFrame'].location.href='../Split.asp?ButtonSymbol=DownSearch&OpStr=下载管理 >> <font color=red>搜索结果</font>';</script>")
End If
End If
End If
End With
End Sub
Sub RefreshHtml(Flag)
Dim TempStr,EditStr,AddStr
If Flag=1 Then
TempStr="添加":EditStr="修改下载":AddStr="继续添加下载"
Else
TempStr="修改":EditStr="继续修改下载":AddStr="添加下载"
End If
With Response
.Write "<link href='../Inc/Admin_Style.CSS' rel='stylesheet' type='text/css'>"
.Write " <table bgcolor=""#CCCCCC"" style=""margin-top:15px"" align=center width=""80%"" border=""0"" cellpadding=""2"" cellspacing=""1"">"
.Write " <tr align=center bgcolor=""#F4F4EA""> "
.Write " <td height=""28"" align=""center"" class=""title""><b>" & TempStr &"下载成功</b></td>" & vbcrlf
.Write " </tr>"
.Write " <tr bgcolor=""#FFFFFF"" height=""20""> "
.Write " <td><table width=""100%"" bgcolor=""#efefef"" border=""0"" cellpadding=""2"" cellspacing=""1"">" & vbcrlf
.Write " <tr bgcolor=""#ffffff"" height=""20""> " & vbcrlf
.Write " <td width=""100"" align=""right""><strong>所属栏目:</strong></td>"
.Write " <td>" & KSCMS.ReturnClassName(Tid) & "</td>"
.Write " </tr>"
.Write " <tr bgcolor=""#ffffff"" height=""20""> "
.Write " <td width=""100"" align=""right""><strong>下载名称:</strong></td>"
.Write " <td>" & Title & "</td>"
.Write " </tr>"
.Write " <tr bgcolor=""#ffffff"" height=""20""> "
.Write " <td width=""100"" align=""right""><strong>作者/开发商:</strong></td>"
.Write " <td>" & Author & "</td>"
.Write " </tr>"
.Write " <tr bgcolor=""#ffffff"" height=""20""> "
.Write " <td width=""100"" align=""right""><strong>来 源:</strong></td>"
.Write " <td>" & Origin & "</td>"
.Write " </tr>"
.Write " <tr bgcolor=""#ffffff"" height=""20""> "
.Write " <td width=""100"" align=""right""><strong>关 键 字:</strong></td>"
.Write " <td>" & KeyWords & "</td>"
.Write " </tr>"
.Write " </table></td>"
.Write " </tr>"
.Write " <tr bgcolor=""#F4F4EA""> "
.Write " <td height=""28"" align=""center"">【<a href=""#"" onclick=""location.href='Down_Add.asp?DisplayMode=" & DisplayMode & "&Page=" & Page & "&Action=Edit&KeyWord=" & KeyWord &"&SearchType=" & SearchType &"&StartDate=" & StartDate & "&EndDate=" & EndDate &"&DownID=" &DownID & "';""><strong>" & EditStr &"</strong></a>】 【<a href=""#"" onclick=""location.href='Down_add.asp?DisplayMode=" & DisplayMode & "&Action=Add&FolderID=" & Tid & "';parent.frames['BottomFrame'].location.href='../Split.asp?OpStr=添加下载&ButtonSymbol=AddDown&FolderID=" & Tid & "';""><strong>" & AddStr & "</strong></a>】 【<a href=""#"" onclick=""location.href='Down_main.asp?DisplayMode=" & DisplayMode & "&ID=" & Tid & "';parent.frames['BottomFrame'].location.href='../Split.asp?ButtonSymbol=ViewDownFolder&FolderID=" & Tid & "';""><strong>下载管理</strong></a>】 【<a href=""" & KSCMS.GetDomain &"DownLoad/ShowInfo.asp?ID=" & DownID & """ target=""_blank""><strong>预览下载内容</strong></a>】</td>"
.Write " </tr>"
.Write " </table>"
'判断是否立即发布
If Makehtml = 1 Then
.Write "<div style=""margin-top:15px;border: #E7E7E7;height:296; overflow: auto; width:100%"">"
If KSCMS.GetChannelConfig(3,"FsoHtmlTF")=0 Then
.Write "<div style=""margin-left:140;height:25px""><li>由于下载中心没有启用生成HTML的功能,所以ID号为 <font color=red>" & DownID & "</font> 的下载没有生成!</li></div> "
.Write "<div style=""margin-left:140;height:25px""><li>由于下载中心没有启用生成HTML的功能,所以ID号为 <font color=red>" & TID & "</font> 的栏目没有生成!</li></div> "
Else
.Write "<div align=center><iframe src=""../Refresh/RefreshHtmlSave.Asp?ChannelID=3&Types=Content&RefreshFlag=ID&DownID=" & DownID &""" width=""98%"" height=""80"" frameborder=""0""></iframe></div>"
Dim ObjRS:Set ObjRS=Server.CreateObject("Adodb.Recordset")
ObjRS.Open "Select TS From KS_Class Where ID='" & Tid &"'",Conn,1,1
If Not ObjRS.Eof Then
Dim FolderIDArr:FolderIDArr=Split(left(ObjRS(0),Len(ObjRS(0))-1),",")
For I=0 To Ubound(FolderIDArr)
.Write "<div align=center><iframe src=""../Refresh/RefreshHtmlSave.Asp?ChannelID=3&Types=Folder&RefreshFlag=ID&FolderID=" & FolderIDArr(i) &""" width=""98%"" height=""90"" frameborder=""0""></iframe></div>"
Next
End If
ObjRS.Close:Set ObjRS=Nothing
End If
If Split(KSCMS.GetConfig("FsoIndex"),".")(1)="asp" Then
.Write "<div style=""margin-left:140;color:blue;height:25px""><li>由于 <a href=""" & KSCMS.GetDomain & """ target=""_blank""><font color=red>网站首页</font></a> 没有启用生成HTML的功能,所以没有生成!</li></div>"
Else
.Write "<div align=center><iframe src=""../Refresh/RefreshIndex.asp?RefreshFlag=Info"" width=""98%"" height=""80"" frameborder=""0""></iframe></div>"
End If
.Write "</div>"
End If
End With
End Sub
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -