📄 refreshhtmlsave.asp
字号:
End If
If RefreshTotalNum = "" Then
Set TotalRS = Server.CreateObject("Adodb.RecordSet")
TotalRS.Open "Select count(*) from KS_Photo where Verific=1 and DelTF=0 And AddDate >= '" & StartDate & "' And AddDate <= '" & EndDate & "'", Conn, 1, 1
RefreshTotalNum = TotalRS(0)
TotalRS.Close:Set TotalRS = Nothing
End If
Else 'Access
If AlreadyRefreshByID = "" Then
RefreshSql = "Select top 1 * from KS_Photo where Verific=1 and DelTF=0 And AddDate>= #" & StartDate & "# And AddDate <=#" & EndDate & "# Order By ID Desc"
Else
RefreshSql = "Select top 1 * from KS_Photo where ID<" & AlreadyRefreshByID & " And Verific=1 and DelTF=0 And AddDate >= #" & StartDate & "# And AddDate <=#" & EndDate & "# Order By ID Desc"
End If
If RefreshTotalNum = "" Then
Set TotalRS = Server.CreateObject("Adodb.RecordSet")
TotalRS.Open "Select count(*) from KS_Photo where Verific=1 and DelTF=0 And AddDate >= #" & StartDate & "# And AddDate <=#" & EndDate & "#", Conn, 1, 1
RefreshTotalNum = TotalRS(0)
TotalRS.Close
Set TotalRS = Nothing
End If
End If
Case "All"
If AlreadyRefreshByID = "" Then
RefreshSql = "Select top 1 * from KS_Photo where Verific=1 and DelTF=0 Order By ID Desc"
Else
RefreshSql = "Select top 1 * from KS_Photo where ID<" & AlreadyRefreshByID & " And Verific=1 and DelTF=0 Order By ID Desc"
End If
If RefreshTotalNum = "" Then
Set TotalRS = Server.CreateObject("Adodb.RecordSet")
TotalRS.Open "Select count(*) from KS_Photo where Verific=1 and DelTF=0", Conn, 1, 1
RefreshTotalNum = TotalRS(0)
TotalRS.Close
Set TotalRS = Nothing
End If
Case "Folder"
FolderID = Trim(Request("FolderID"))
If RefreshTotalNum = "" And FolderID <> "" Then
Set TotalRS = Server.CreateObject("Adodb.RecordSet")
TotalRS.Open "Select count(*) from KS_Photo where Verific=1 and DelTF=0 And Tid IN (" & FolderID & ")", Conn, 1, 1
RefreshTotalNum = TotalRS(0)
TotalRS.Close
Set TotalRS = Nothing
End If
If CInt(NowNum) < CInt(RefreshTotalNum) And FolderID <> "" Then
If AlreadyRefreshByID = "" Then
RefreshSql = "Select top 1 * from KS_Photo where Verific=1 and DelTF=0 And Tid IN(" & FolderID & ") Order By ID Desc"
Else
RefreshSql = "Select top 1 * from KS_Photo where ID<" & AlreadyRefreshByID & " And Verific=1 and DelTF=0 And Tid in(" & FolderID & ") Order By ID Desc"
End If
Else
RefreshSql = ""
End If
Case Else
RefreshSql = ""
RefreshTotalNum = 0
End Select
If RefreshSql <> "" Then
Set RefreshRS = Server.CreateObject("ADODB.RecordSet")
RefreshRS.Open RefreshSql, Conn, 1, 1
If RefreshRS.EOF And RefreshRS.BOF Then
Call Main
If NowNum <> 0 Then
.Write "<script>img2.width=" & Fix((NowNum / RefreshTotalNum) * 400) & ";" & vbCrLf
.Write "txt2.innerHTML=""生成图片结束!" & FormatNumber(NowNum / RefreshTotalNum * 100, 0, -1) & """;" & vbCrLf
.Write "txt3.innerHTML=""总共生成了 <font color=red><b>" & RefreshTotalNum & "</b></font> 组图片,总费时:<font color=red>" & Left((Timer() - StartRefreshTime), 4) & "</font> 秒<br><br><input name='button1' type='button' onclick=javascript:location='RefreshHtml.asp?ChannelID=2'; class='buttonstyle' value=' 返 回 '>"";" & vbCrLf
.Write "img2.title=""(" & NowNum & ")"";</script>" & vbCrLf
Else
.Write "<script>img2.width=""0"";" & vbCrLf
.Write "txt2.innerHTML=""没有可生成的图片!<br><br><input name='button1' type='button' onclick=javascript:location='RefreshHtml.asp?ChannelID=2'; class='buttonstyle' value=' 返 回 '>"";" & vbCrLf
.Write "txt3.innerHTML="""";" & vbCrLf
.Write "txt4.innerHTML="""";" & vbCrLf
.Write "document.all.BarShowArea.style.display='none';" & vbCrLf
.Write "</script>" & vbCrLf
End If
.Flush
Exit Sub
Else
On Error Resume Next
If RefreshRS("ReadPoint")>0 Or KSCMS.GetChannelConfig(ChannelID,"FsoHtmlTF")=0 Or RefreshRS("InfoPurview")=2 Or (RefreshRS("InfoPurview")=0 And (KSCMS.GetClassConfig(RefreshRS("Tid"),"ClassPurview")=1 Or KSCMS.GetClassConfig(RefreshRS("Tid"),"ClassPurview")=2)) Then
FsoHtmlList="<table border=""0"">"_
& "<tr><td><li><strong>ID 号为:</strong></li></td><td> <font color=red>" & RefreshRS("ID") & "</font> 的图片没有生成!</td></tr>"_
& "<tr><td><li><strong>可能原因:</strong></li></td><td>1、图片频道没有启用生成静态HTML生成功能;<br>2、该图片所在的栏目为半开放栏目或是认证栏目;<br>3、该图片设置了需要扣点浏览或是设定游客不能浏览;<br>"_
& "</table>"
Else
Dim FsoHtmlPath:FsoHtmlPath=KSCMS.GetFolderPath(RefreshRS("Tid"), False) & RefreshRS("Fname")
FsoHtmlList="<table border=""0"">"_
& "<tr><td><li><strong>ID 号为:</strong></li></td><td> <font color=red>" & RefreshRS("ID") & "</font> 的图片已生成</td></tr>"_
& "<tr><td><li><strong>图片名称:</strong></li></td><td><font color=red>" & RefreshRS("Title") & "</font></li></td><tr>" _
& "<tr><td><li><strong>生成路径:</strong></li></td><td><a href=""" & FsoHtmlPath & """ target=""_blank"">" & FsoHtmlPath & "</a></li></td><tr>" _
& "</table>"
Call KSRObj.RefreshPictureContent(RefreshRS)
End If
If RefreshFlag="ID" Then
Call Main
.End
End If
NowNum = NowNum + 1
AlreadyRefreshByID = RefreshRS("ID")
If Err.Number <> 0 Then
ReturnInfo = "操作失败!<br><font color=red>" & Err.Description & "</font>"
Call Main
Exit Sub
End If
.Write ("<meta http-equiv=""refresh"" content=""0;url='RefreshHtmlSave.asp?Types=Content&ChannelID=2&RefreshTotalNum=" & RefreshTotalNum & "&StartRefreshTime=" & Server.URLEncode(StartRefreshTime) & "&NowNum=" & NowNum & "&TotalNum=" & TotalNum & "&StartDate=" & Server.URLEncode(StartDate) & "&EndDate=" & Server.URLEncode(EndDate) & "&FolderID=" & Server.URLEncode(FolderID) & "&AlreadyRefreshByID=" & AlreadyRefreshByID & "&RefreshFlag=" & RefreshFlag & "'"">")
Call Main
.Write "<script>img2.width=" & Fix((NowNum / RefreshTotalNum) * 400) & ";" & vbCrLf
.Write "txt2.innerHTML=""生成进度:" & FormatNumber(NowNum / RefreshTotalNum * 100, 2, -1) & """;" & vbCrLf
.Write "txt3.innerHTML=""总共需要生成 <font color=red><b>" & RefreshTotalNum & "</b></font> 组图片,<font color=red><b>在此过程中请勿刷新此页面!!!</b></font> 系统正在生成第 <font color=red><b>" & NowNum & "</b></font> 组图片"";" & vbCrLf
.Write "img2.title=""(" & NowNum & ")"";</script>" & vbCrLf
.Flush
End If
Set RefreshRS = Nothing
Else
Call Main
If NowNum <> 0 Then
.Write "<script>img2.width=" & Fix((NowNum / RefreshTotalNum) * 400) & ";" & vbCrLf
.Write "txt2.innerHTML=""生成图片结束!" & FormatNumber(NowNum / RefreshTotalNum * 100, 0, -1) & """;" & vbCrLf
.Write "txt3.innerHTML=""总共生成了 <font color=red><b>" & RefreshTotalNum & "</b></font> 组图片,总费时:<font color=red>" & Left((Timer() - StartRefreshTime), 4) & "</font> 秒<br><br><input name='button1' type='button' onclick=javascript:location='RefreshHtml.asp?ChannelID=2'; class='buttonstyle' value=' 返 回 '>"";" & vbCrLf
.Write "img2.title=""(" & NowNum & ")"";</script>" & vbCrLf
Else
.Write "<script>img2.width=""0"";" & vbCrLf
.Write "txt2.innerHTML=""没有可生成的图片!<br><br><input name='button1' type='button' onclick=javascript:location='RefreshHtml.asp?ChannelID=2'; class='buttonstyle' value=' 返 回 '>"";" & vbCrLf
.Write "txt3.innerHTML="""";" & vbCrLf
.Write "txt4.innerHTML="""";" & vbCrLf
.Write "document.all.BarShowArea.style.display='none';" & vbCrLf
.Write "</script>" & vbCrLf
End If
.Flush
Exit Sub
End If
End With
End Sub
'生成图片栏目页的处理过程
Sub RefreshFolderPicture()
With Response
Dim FolderID, RefreshSql, RefreshTotalNum, RefreshRS, NewsTotalNum, NewsNo
RefreshSql = Trim(Request("RefreshSql"))
NewsNo = Request("NewsNo")
If NewsNo = "" Then NewsNo = 0
If RefreshSql = "" Then
Select Case RefreshFlag
Case "ID"
FolderID = Trim(Request("FolderID"))
If FolderID <> "" Then
RefreshSql = "Select * from KS_Class where ChannelID=2 and DelTF=0 And ID ='" & FolderID & "'"
Else
RefreshSql = "Select * From KS_Class Where 1=0"
End If
Case "Folder"
FolderID = Trim(Request("FolderID"))
If FolderID <> "" Then
RefreshSql = "Select * from KS_Class where ChannelID=2 and DelTF=0 And ID IN (" & FolderID & ") Order By FolderOrder ASC"
Else
RefreshSql = "Select * From KS_Class Where 1=0"
End If
Case "All"
RefreshSql = "Select * from KS_Class where ChannelID=2 and DelTF=0 Order By FolderOrder ASC"
Case Else
RefreshSql = ""
RefreshTotalNum = 0
End Select
End If
If RefreshSql <> "" Then
Set RefreshRS = Server.CreateObject("ADODB.RecordSet")
RefreshRS.Open RefreshSql, Conn, 1, 1
NewsTotalNum = RefreshRS.RecordCount
If RefreshRS.EOF Then
Call Main
If NewsNo <> 0 Then
.Write "<script>img2.width=" & Fix((NewsNo / NewsTotalNum) * 400) & ";" & vbCrLf
.Write "txt2.innerHTML=""生成图片栏目结束!" & FormatNumber(NewsNo / NewsTotalNum * 100, 0, -1) & """;" & vbCrLf
.Write "txt3.innerHTML=""总共生成了 <font color=red><b>" & NewsTotalNum & "</b></font> 个图片栏目,总费时:<font color=red>" & Left((Timer() - StartRefreshTime), 4) & "</font> 秒<br><br><input name='button1' type='button' onclick=javascript:location='RefreshHtml.asp?ChannelID=2'; class='buttonstyle' value=' 返 回 '>"";" & vbCrLf
.Write "img2.title=""(" & NewsNo & ")"";</script>" & vbCrLf
Else
.Write "<script>img2.width=""0"";" & vbCrLf
.Write "txt2.innerHTML=""没有可生成的图片栏目!<br><br><input name='button1' type='button' onclick=javascript:location='RefreshHtml.asp?ChannelID=2'; class='buttonstyle' value=' 返 回 '>"";" & vbCrLf
.Write "txt3.innerHTML="""";" & vbCrLf
.Write "txt4.innerHTML="""";" & vbCrLf
.Write "document.all.BarShowArea.style.display='none';" & vbCrLf
.Write "</script>" & vbCrLf
End If
.Flush
Exit Sub
Else
RefreshRS.Move NewsNo
If Not RefreshRS.EOF Then
If RefreshRS("ClassPurview")=2 Then
FsoHtmlList="<table border=""0"">"_
& "<tr><td><li><strong>ID号为:</strong></li></td><td> <font color=red>" & RefreshRS("ID") & "</font> 的栏目没有生成!</td></tr>"_
& "<tr><td><li><strong>原 因:</strong></li></td><td>该栏目设置为认证栏目"_
& "</table>"
Else
Dim FsoHtmlPath:FsoHtmlPath=KSCMS.GetFolderPath(RefreshRS("ID"), true)
FsoHtmlList="<table border=""0"">"_
& "<tr><td><li><strong>ID 号 为:</strong></li></td><td> <font color=red>" & RefreshRS("ID") & "</font> 的栏目</td></tr>"_
& "<tr><td><li><strong>栏目名称:</strong></li></td><td><font color=red>" & RefreshRS("FolderName") & "</font></li></td><tr>" _
& "<tr><td><li><strong>生成路径:</strong></li></td><td><a href=""" & FsoHtmlPath & """ target=""_blank"">" & FsoHtmlPath & "</a></li></td><tr>" _
& "</table>"
Call KSRObj.RefreshPictureFolder(RefreshRS) '调用图片栏目刷新函数
End If
If RefreshFlag="ID" Then
Call Main
.End
End If
NewsNo = NewsNo + 1
.Write ("<meta http-equiv=""refresh"" content=""0;url='RefreshHtmlSave.asp?Types=Folder&ChannelID=2&StartRefreshTime=" & StartRefreshTime & "&NewsNo=" & NewsNo & "&RefreshSql=" & Server.URLEncode(RefreshSql) & "&RefreshFlag=" & RefreshFlag & "'"">")
Call Main
.Write "<script>img2.width=" & Fix((NewsNo / NewsTotalNum) * 400) & ";" & vbCrLf
.Write "txt2.innerHTML=""生成进度:" & FormatNumber(NewsNo / NewsTotalNum * 100, 2, -1) & """;" & vbCrLf
.Write "txt3.innerHTML=""总共需要生成 <font color=red><b>" & NewsTotalNum & "</b></font> 个图片栏目,<font color=red><b>在此过程中请勿刷新此页面!!!</b></font> 系统正在生成第 <font color=red><b>" & NewsNo & "</b></font> 个图片栏目"";" & vbCrLf
.Write "img2.title=""(" & NewsNo & ")"";</script>" & vbCrLf
.Flush
Else
Call Main
If NewsNo <> 0 Then
.Write "<script>img2.width=" & Fix((NewsNo / NewsTotalNum) * 400) & ";" & vbCrLf
.Write "txt2.innerHTML=""生成图片栏目结束!" & FormatNumber(NewsNo / NewsTotalNum * 100, 0, -1) & """;" & vbCrLf
.Write "txt3.innerHTML=""总共生成了 <font color=red><b>" & NewsTotalNum & "</b></font> 个图片栏目,总费时:<font color=red>" & Left((Timer() - StartRefreshTime), 4) & "</font> 秒<br><br><input name='button1' type='button' onclick=javascript:location='RefreshHtml.asp?ChannelID=2'; class='buttonstyle' value=' 返 回 '>"";" & vbCrLf
.Write "img2.title=""(" & NewsNo & ")"";</script>" & vbCrLf
Else
.Write "<script>img2.width=""0"";" & vbCrLf
.Write "txt2.innerHTML=""没有可生成的图片栏目!<br><br><input name='button1' type='button' onclick=javascript:location='RefreshHtml.asp?ChannelID=2'; class='buttonstyle' value=' 返 回 '>"";" & vbCrLf
.Write "txt3.innerHTML="""";" & vbCrLf
.Write "txt4.innerHTML="""";" & vbCrLf
.Write "document.all.BarShowArea.style.display='none';" & vbCrLf
.Write "</script>" & vbCrLf
End If
.Flush
End If
Set RefreshRS = Nothing
End If
Set RefreshRS = Nothing
Else
ReturnInfo = "对不起,您没有选择要发布的图片栏目 <font color=""red""><a href=""RefreshHtml.asp?ChannelID=2"">返回</a></font>"
Call Main
End If
End With
End Sub
'生成下载内容页的处理过程
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -