📄 picture_add.asp
字号:
HitsByDay = KSCMS.G("HitsByDay"):If HitsByDay = "" Or Not IsNumeric(HitsByDay) Then HitsByDay = 0
HitsByWeek = KSCMS.G("HitsByWeek"):If HitsByWeek = "" Or Not IsNumeric(HitsByWeek) Then HitsByWeek = 0
HitsByMonth = KSCMS.G("HitsByMonth"):If HitsByMonth = "" Or Not IsNumeric(HitsByMonth) Then HitsByMonth = 0
PicUrls = Trim(KSCMS.G("PicUrls"))
Recommend = KSCMS.G("Recommend"):If Recommend = "" Then Recommend = 0
Rolls = KSCMS.G("Rolls"):If Rolls = "" Then Rolls = 0
Strip = KSCMS.G("Strip"):If Strip = "" Then Strip = 0
Popular = KSCMS.G("Popular"):If Popular = "" Then Popular = 0
Verific = KSCMS.G("Verific"):If Verific = "" Then Verific = 0
Comment = KSCMS.G("Comment"):If Comment = "" Then Comment = 0
Slide = KSCMS.G("Slide"):If Slide = "" Then Slide = 0
BeyondSavePic = KSCMS.G("BeyondSavePic"):If BeyondSavePic = "" Then BeyondSavePic = 0
Makehtml = KSCMS.G("Makehtml"):If Makehtml = "" Then Makehtml = 0
FnameType = Trim(KSCMS.G("Fnametype"))
Tid = Trim(KSCMS.G("Tid"))
KeyWords = KSCMS.G("KeyWords")
Author = KSCMS.G("Author")
Origin = KSCMS.G("Origin")
AddDate = KSCMS.G("AddDate")
Rank = Trim(KSCMS.G("Rank"))
TemplateID = KSCMS.G("TemplateID"):If TemplateID = "" Then TemplateID = 0
PictureFsoType = KSCMS.G("PictureFsoType"):If PictureFsoType = "" Then PictureFsoType = 1
If Action = "Add" OR Action="Verify" Then '取得生成文件名
Fname = KSCMS.GetFileName(PictureFsoType, AddDate, FnameType)
End If
If Title = "" Then .Write ("<script>alert('图片名称不能为空!');history.back(-1);</script>")
If PhotoUrl = "" Then .Write ("<script>alert('图片缩略图不能为空!');history.back(-1);</script>")
Set PictureRS = 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_Photo where Title='" & Title & "' And Tid='" & Tid & "'"
PictureRS.Open SqlStr, conn, 1, 1
If Not PictureRS.EOF Then
ErrMsg = ErrMsg & "该类别已存在此篇图片! \n"
End If
PictureRS.Close
End If
If ErrMsg <> "" Then
.Write ("<script>alert('" & ErrMsg & "');history.back(-1);</script>")
.End
Else
'判断是否远程存图
If CInt(BeyondSavePic) = 1 Then
If CStr(KSCMS.GetConfig("SaveImgByDate")) = "1" Then
SaveFilePath = "/" & KSCMS.GetConfig("BeyondPicDir") & Year(Now()) & "-" & Right("0" & Month(Now()), 2) & "/"
Else
SaveFilePath = "/" & KSCMS.GetConfig("BeyondPicDir")
End If
KSCMS.CreateListFolder (SaveFilePath)
PicUrls = Replace(KSCMS.ReplaceBeyondUrl(PicUrls, SaveFilePath), KSCMS.GetDomain(), "/")
PictureContent = KSCMS.ReplaceBeyondUrl(PictureContent, SaveFilePath)
End If
If Action = "Add" Or Action="Verify" Then
SqlStr = "select * from KS_Photo where PicID=null"
PictureRS.Open SqlStr, conn, 1, 3
PictureRS.AddNew
'生成图片ID
PictureRS("PicID") = PicID
PictureRS("Title") = Title
PictureRS("PhotoUrl") = PhotoUrl
PictureRS("PictureContent") = KSCMS.ReplaceInnerLink(PictureContent)
PictureRS("PicUrls") = PicUrls
PictureRS("Recommend") = Recommend
PictureRS("Rolls") = Rolls
PictureRS("Strip") = Strip
PictureRS("Popular") = Popular
PictureRS("Verific") = Verific
PictureRS("Comment") = Comment
PictureRS("Tid") = Tid
PictureRS("KeyWords") = KeyWords
PictureRS("Author") = Author
PictureRS("Origin") = Origin
PictureRS("AddDate") = AddDate
PictureRS("Rank") = Rank
PictureRS("Slide") = Slide
PictureRS("BeyondSavePic") = BeyondSavePic
PictureRS("TemplateID") = TemplateID
PictureRS("Hits") = Hits
PictureRS("HitsByDay") = HitsByDay
PictureRS("HitsByWeek") = HitsByWeek
PictureRS("HitsByMonth") = HitsByMonth
PictureRS("PictureFsoType") = PictureFsoType
PictureRS("Fname") = Fname
if Action="Verify" Then
PictureRS("PictureInput") = Trim(KSCMS.G("PictureInput"))
Else
PictureRS("PictureInput") = Request.Cookies(KSCMS.SiteSn)("AdminName")
End IF
PictureRS("RefreshTF") = Makehtml
PictureRS("Score") = 0
PictureRS("DelTF") = 0
PictureRS("OrderID") = 1
PictureRS.Update
'写入Session,添加下一篇图片调用
Session("KeyWords") = KeyWords
Session("Author") = Author
Session("Origin") = Origin
Call RefreshHtml(1)
PictureRS.Close:Set PictureRS = Nothing
ElseIf Action = "Edit" Then
PicID = Trim(Request("PicID"))
SqlStr = "SELECT * FROM KS_Photo Where PicID='" & PicID & "'"
PictureRS.Open SqlStr, conn, 1, 3
If PictureRS.EOF And PictureRS.BOF Then
.Write ("<script>alert('参数传递出错!');history.back(-1);</script>")
.End
End If
PictureRS("Title") = Title
PictureRS("PhotoUrl") = PhotoUrl
PictureRS("PictureContent") = PictureContent
PictureRS("PicUrls") = PicUrls
PictureRS("Recommend") = Recommend
PictureRS("Rolls") = Rolls
PictureRS("Strip") = Strip
PictureRS("Popular") = Popular
PictureRS("Verific") = Verific
PictureRS("Comment") = Comment
PictureRS("Tid") = Tid
PictureRS("KeyWords") = KeyWords
PictureRS("Author") = Author
PictureRS("Origin") = Origin
PictureRS("AddDate") = AddDate
PictureRS("Rank") = Rank
PictureRS("Slide") = Slide
PictureRS("BeyondSavePic") = BeyondSavePic
PictureRS("TemplateID") = TemplateID
PictureRS("Fname") = Replace(PictureRS("Fname"), Trim(Mid(Trim(PictureRS("Fname")), InStrRev(Trim(PictureRS("Fname")), "."))), FnameType)
If Makehtml = 1 Then
PictureRS("RefreshTF") = 1
End If
PictureRS("Hits") = Hits
PictureRS("HitsByDay") = HitsByDay
PictureRS("HitsByWeek") = HitsByWeek
PictureRS("HitsByMonth") = HitsByMonth
PictureRS("PictureFsoType") = PictureFsoType
PictureRS.Update
Call RefreshHtml(2)
PictureRS.Close:Set PictureRS = Nothing
If KeyWord <>"" Then
.Write ("<script> parent.frames['MainFrame'].focus();alert('图片修改成功!');location.href='Picture_main.asp?DisplayMode=" & DisplayMode & "&Page=" & Page & "&KeyWord=" & KeyWord & "&SearchType=" & SearchType & "&StartDate=" & StartDate & "&EndDate=" & EndDate & "';parent.frames['BottomFrame'].location.href='../Split.asp?ButtonSymbol=PictureSearch&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='Picture_Add.asp?DisplayMode=" & DisplayMode & "&Page=" & Page & "&Action=Edit&KeyWord=" & KeyWord &"&SearchType=" & SearchType &"&StartDate=" & StartDate & "&EndDate=" & EndDate &"&PicID=" & PicID & "';""><strong>" & EditStr &"</strong></a>】 【<a href=""#"" onclick=""location.href='Picture_add.asp?DisplayMode=" & DisplayMode & "&Action=Add&FolderID=" & Tid & "';parent.frames['BottomFrame'].location.href='../Split.asp?OpStr=添加图片&ButtonSymbol=AddPicture&FolderID=" & Tid & "';""><strong>" & AddStr & "</strong></a>】 【<a href=""#"" onclick=""location.href='Picture_main.asp?DisplayMode=" & DisplayMode & "&ID=" & Tid & "';parent.frames['BottomFrame'].location.href='../Split.asp?ButtonSymbol=ViewPictureFolder&FolderID=" & Tid & "';""><strong>图片管理</strong></a>】 【<a href=""" & KSCMS.GetDomain &"Photo/ShowInfo.asp?ID=" & PicID & """ 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(2,"FsoHtmlTF")=0 Then
.Write "<div style=""margin-left:140;height:25px""><li>由于图片中心没有启用生成HTML的功能,所以ID号为 <font color=red>" & PicID & "</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=2&Types=Content&RefreshFlag=ID&PicID=" & PicID &""" 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=2&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 + -