📄 admin_itemloadview.asp
字号:
<!-- #include file="../conn.asp" --><%Response.buffer=False %>
<!-- #include file="session.asp" -->
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/GetFunction.asp"-->
<!--#include file="../inc/upfile.asp"-->
<%
act = Request("act")
if act = "makebook" then
response.write "<link href=css.css rel=stylesheet type=text/css>"
Fastbook = Request("Fastbook")
If Fastbook="" or Fastbook=null Then
Fastbook=0
end if
flushbook = Request("flushbook")
If flushbook="" or flushbook=null Then
flushbook=0
end if
getstartid=request("startid")
getendid=request("endid")
CheckSqlnum(getstartid)
CheckSqlnum(getendid)
if getendid="" or getstartid="" then
response.write "<script language=javascript>alert('请正确填写作品编号!');history.back(-1);</script>"
response.End
end if
if getendid-getstartid<0 then
response.write "<script language=javascript>alert('未指定有效的作品编号!');history.back(-1);</script>"
response.End
end if
Server.ScriptTimeOut=12000000 '设定操作超时的时间
set rsv=server.createobject("ADODB.recordset")
if flushbook = 1 then
rsv.open "select id,view_id,view_type,view_ok,view_ok2,view_size,view_get,view_SaveToTXT,ItemID from list_view where view_id>="&getstartid&" and view_id<="&getendid&" ORDER BY id",conn,1,3
else
rsv.open "select id,view_id,view_type,view_ok,view_ok2,view_size,view_get,view_SaveToTXT,ItemID from list_view where view_id>="&getstartid&" and view_id<="&getendid&" and view_get=0 ORDER BY id",conn,1,3
end if
if rsv.eof and rsv.bof then
response.write "<script language=javascript>alert('错误! \n\n 指定范围内没有作品章节存在!');history.back(-1);</script>"
response.end
else
do while not rsv.eof
if rsv("view_ok")<>"" then
Set Rs=server.CreateObject("adodb.recordset")
Sql="Select top 1 EquivType,readtype,readtype1,IsSaveFiles,CsType,CsString,CoType,CoString,CsType1,CsString1,CoType1,CoString1,ContType1,ContType2,CsType2,CsString2,CoType2,CoString2,JDTHType1,JDTHType2,JDTHType3,JDTH1sStr,JDTH2sStr,JDTH3sStr,JDTH1oStr,JDTH2oStr,JDTH3oStr,GJTHType1,GJTHType2,GJTHType3,GJTH1sStr,GJTH2sStr,GJTH3sStr,GJTH1oStr,GJTH2oStr,GJTH3oStr,GJTH1cStr,GJTH2cStr,GJTH3cStr from [Item] Where ItemID=" & rsv("ItemID")
Rs.Open Sql,ConnItem,1,1
if not(rs.eof and rs.bof) then
EquivType=Rs("EquivType")
readtype=Rs("readtype")
readtype1=Rs("readtype1")
CsType=Rs("CsType")
CsString=Rs("CsString")
CoType=Rs("CoType")
CoString=Rs("CoString")
ContType1=Rs("ContType1")
CsType1=Rs("CsType1")
CoType1=Rs("CoType1")
CoString1=Rs("CoString1")
ContType1=Rs("ContType1")
ContType2=Rs("ContType2")
CsType2=Rs("CsType2")
CsString2=Rs("CsString2")
CoType2=Rs("CoType2")
CoString2=Rs("CoString2")
JDTHType1=Rs("JDTHType1")
JDTHType2=Rs("JDTHType2")
JDTHType3=Rs("JDTHType3")
JDTH1sStr=Rs("JDTH1sStr")
JDTH1oStr=Rs("JDTH1oStr")
JDTH2sStr=Rs("JDTH2sStr")
JDTH2oStr=Rs("JDTH2oStr")
JDTH3sStr=Rs("JDTH3sStr")
JDTH3oStr=Rs("JDTH3oStr")
GJTHType1=Rs("GJTHType1")
GJTHType2=Rs("GJTHType2")
GJTHType3=Rs("GJTHType3")
GJTH1sStr=Rs("GJTH1sStr")
GJTH1oStr=Rs("GJTH1oStr")
GJTH1cStr=Rs("GJTH1cStr")
GJTH2sStr=Rs("GJTH2sStr")
GJTH2oStr=Rs("GJTH2oStr")
GJTH2cStr=Rs("GJTH2cStr")
GJTH3sStr=Rs("GJTH3sStr")
GJTH3oStr=Rs("GJTH3oStr")
GJTH3cStr=Rs("GJTH3cStr")
if readtype=1 and readtype1=1 then
response.write "<br>章节<b> "&rsv("view_type")&" </b>的内容从分卷页获取,不支持强制更新!"
Else
ViewUrl=rsv("view_ok")
ContentCode=GetHttpPage(ViewUrl,EquivType)
If ContentCode<>"$False$" Then
If ContType2=2 Then
if CsType2=1 then
CsType2=true
elseif CsType2=0 then
CsType2=False
end if
if CoType2=1 then
CoType2=true
elseif CoType2=0 then
CoType2=False
end if
Content=GetBody(ContentCode,CsString2,CoString2,CsType2,CoType2)
If Content="$False$" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>章节<b> "&rsv("view_type")&" </b>在截取正文的时候发生错误:" & ViewUrl & "</li>"
Else
If ContType2=3 Then
Content="<IMG src="&Content&">"
End If
If JDTHType1=1 Then
Content=Replace(Content,JDTH1sStr,JDTH1oStr)
End If
If JDTHType2=1 Then
Content=Replace(Content,JDTH2sStr,JDTH2oStr)
End If
If JDTHType3=1 Then
Content=Replace(Content,JDTH3sStr,JDTH3oStr)
End If
If GJTHType1=1 Then
ContentCode1=GetArray(Content,GJTH1sStr,GJTH1oStr,true,true)
ContentArray1=Split(ContentCode1,"$Array$")
For i1=0 To Ubound(ContentArray1)
Content=Replace(Content,ContentArray1(i1),GJTH1cStr)
Next
End If
If GJTHType2=1 Then
ContentCode2=GetArray(Content,GJTH2sStr,GJTH2oStr,true,true)
ContentArray2=Split(ContentCode2,"$Array$")
For i2=0 To Ubound(ContentArray2)
Content=Replace(Content,ContentArray2(i2),GJTH2cStr)
Next
End If
If GJTHType3=1 Then
ContentCode3=GetArray(Content,GJTH3sStr,GJTH3oStr,true,true)
ContentArray3=Split(ContentCode3,"$Array$")
For i3=0 To Ubound(ContentArray3)
Content=Replace(Content,ContentArray3(i3),GJTH3cStr)
Next
End If
End If
else
if CsType=1 then
CsType=true
elseif CsType=0 then
CsType=False
end if
if CoType=1 then
CoType=true
elseif CoType=0 then
CoType=False
end if
Content=GetBody(ContentCode,CsString,CoString,CsType,CoType)
If ContType1=1 Then
if CsType1=1 then
CsType1=true
elseif CsType1=0 then
CsType1=False
end if
if CoType1=1 then
CoType1=true
elseif CoType1=0 then
CoType1=False
end if
Content=GetBody(Content,CsString1,CoString1,CsType1,CoType1)
End If
If Content="$False$" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>章节<b> "&rsv("view_type")&" </b>在截取正文的时候发生错误:" & ViewUrl & "</li>"
Else
If ContType2=3 Then
Content="<IMG src="&Content&">"
End If
If JDTHType1=1 Then
Content=Replace(Content,JDTH1sStr,JDTH1oStr)
End If
If JDTHType2=1 Then
Content=Replace(Content,JDTH2sStr,JDTH2oStr)
End If
If JDTHType3=1 Then
Content=Replace(Content,JDTH3sStr,JDTH3oStr)
End If
If GJTHType1=1 Then
ContentCode1=GetArray(Content,GJTH1sStr,GJTH1oStr,true,true)
ContentArray1=Split(ContentCode1,"$Array$")
For i1=0 To Ubound(ContentArray1)
Content=Replace(Content,ContentArray1(i1),GJTH1cStr)
Next
End If
If GJTHType2=1 Then
ContentCode2=GetArray(Content,GJTH2sStr,GJTH2oStr,true,true)
ContentArray2=Split(ContentCode2,"$Array$")
For i2=0 To Ubound(ContentArray2)
Content=Replace(Content,ContentArray2(i2),GJTH2cStr)
Next
End If
If GJTHType3=1 Then
ContentCode3=GetArray(Content,GJTH3sStr,GJTH3oStr,true,true)
ContentArray3=Split(ContentCode3,"$Array$")
For i3=0 To Ubound(ContentArray3)
Content=Replace(Content,ContentArray3(i3),GJTH3cStr)
Next
End If
End If
End If
'----------------------------------------------------------------------------------------------
If Content<>"$False$" Then
picViewPath=SiteSystemPath&"Bookview/"&book_id&"/"
If IsSaveFiles=1 then
Content=Getimages(Content,"管理员:"&request.cookies("CnendWeb")("admininfo_loginname"),picViewPath,1,ID1,True,ViewUrl)
Else
Content=Getimages(Content,"管理员:"&request.cookies("CnendWeb")("admininfo_loginname"),picViewPath,1,ID1,False,ViewUrl)
End If
End If
if SaveToTXT=1 then
BookViewPath="HTML/"&rsv("view_id")&"/"
If Not CreateMultiFolder(SiteSystemPath & BookViewPath) Then
Response.Write "<br><font color='red'><B>创建TXT存放目录失败,可能是由于服务器限制!!</B></font>"&SiteSystemPath & BookViewPath&"<br>"
if Content<>"" and Content<>"$False$" then
rsv("view_get") = 1
rsv("view_SaveToTXT")=0
rsv("view_ok2")=unhtmllist(Content)
if Fastbook=1 then
rsv("view_size")=Len(Content)
end if
rsv.update
response.write "<br>章节<b> "&rsv("view_type")&" </b>的内容<font color=blue>采集成功</font>"
else
response.write "<br>章节<b> "&rsv("view_type")&" </b>的内容采集失败"
end if
else
file=server.mappath( SiteSystemPath & BookViewPath&rsv("id")&".TXT" )
if Content<>"" and Content<>"$False$" then
view_view_ok=""
view_view_ok="document.write('"
view_view_ok=view_view_ok&""&unhtmllist(Content)&""
view_view_ok=view_view_ok&"');"
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.Createtextfile(file,true)
fout.writeline view_view_ok
fout.close
set fso=nothing
if Fastbook=1 then
rsv("view_size")=Len(Content)
end if
rsv("view_get")=1
rsv("view_ok")="/"&BookViewPath&strFileName&id1&".TXT"
rsv("view_SaveToTXT")=1
rsv.update
response.write "<br>章节<b> "&rsv("view_type")&" </b>的内容<font color=blue>采集成功</font>"
else
response.write "<br>章节<b> "&rsv("view_type")&" </b>的内容采集失败"
end if
end if
else
if Content<>"" and Content<>"$False$" then
rsv("view_get")=1
rsv("view_ok2")=unhtmllist(Content)
if Fastbook=1 then
rsv("view_size")=Len(Content)
end if
rsv("view_SaveToTXT")=0
rsv.update
response.write "<br>章节<b> "&rsv("view_type")&" </b>的内容<font color=blue>采集成功</font>"
else
response.write "<br>章节<b> "&rsv("view_type")&" </b>的内容采集失败"
end if
end if
'----------------------------------------------------------------------------------------------
Else
FoundErr=True
ErrMsg=ErrMsg & "<br><li>在截取:" & NewsUrl & "章节内容页时发生错误</li>"
End If
End If
Else
FoundErr=True
ErrMsg=ErrMsg & "<br><li>章节<b> "&rsv("view_type")&" </b>没有发现该章节的采集参数,无法进行采集</li>"
End If
Rs.close
Set Rs=Nothing
Else
FoundErr=True
ErrMsg=ErrMsg & "<br><li>章节<b> "&rsv("view_type")&" </b>没有发现该章节的源文件地址,无法进行采集</li>"
End If
rsv.movenext
loop
end if
rsv.close
set rsv=Nothing
If FoundErr=True Then
Call WriteErrMsg(ErrMsg)
End If
response.write "<p align='center'>作品章节内容单独采集操作全部完成!!【<a href='javascript:onclick=history.go(-1)'>返 回</a>】</p>"
else
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body>
<script language="javascript">
function checkstatus(frm)
{
if (frm.flushbook.checked == true)
if (!confirm("强制更新章节内容,将把所有的章节内容重新采集并更新,请慎重考虑。\n\n"))
{frm.flushbook.checked=false;}
}
function checkstatuss(frm)
{
if (frm.Fastbook.checked == true)
if (!confirm("重新计算章节字数,重新计算章节内容的字数并更新,请慎重考虑。\n\n"))
{frm.Fastbook.checked=false;}
}
</script>
<div id="topmomo">
长篇采集系统项目管理</div>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tborder">
<tr align="center">
<td height="30"><a href="Admin_ItemManage.asp">管理首页</a> |
<a href="Admin_ItemAddNew.asp">添加新项目</a></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tborder" style="LINE-HEIGHT: 150%">
<tr>
<td height="30" align="center" valign="middle" class="thead" colspan="2">
作品章节内容单独采集</td>
</tr>
<tr>
<td height="26" align="center" valign="middle" class="tcat" colspan="2">
请慎重操作,此操作大量占用系统资源每次填写范围请不要过大</td>
</tr>
<form method="get" action>
<tr height="26">
<td width="50%" align="right" class="alt2">采集作品起始ID(本地ID):</td>
<td width="50%" class="alt1">
<input class="form" type="Number" name="startid" id="start" size="20"></td>
</tr>
<tr height="26">
<td width="50%" align="right" class="alt2">采集作品结束ID(本地ID):</td>
<td width="50%" class="alt1">
<input class="form" type="text" name="endid" id="end" size="20"></td>
</tr>
<tr height="26">
<td width="50%" align="right" class="alt2">强制更新章节内容:</td>
<td width="50%" class="alt1">
<input type="checkbox" name="flushbook" onclick="checkstatus(this.form)" value="1" class="form">(将把所有的章节内容重新采集并更新)</td>
</tr>
<tr height="26">
<td width="50%" align="right" class="alt2">重新计算章节字数:</td>
<td width="50%" class="alt1">
<input type="checkbox" name="Fastbook" onclick="checkstatuss(this.form)" value="1" class="form">(重新计算章节内容的字数并更新)</td>
</tr>
<tr>
<td height="30" align="center" colspan="2" class="alt3">
<input type="hidden" name="act" value="makebook" id="act" size="20">
<input class="button" type="submit" value="开始采集" name="B1">
<input class="button" type="reset" value="重置设定" name="B2"> </td>
</tr>
</form>
</table>
</body>
</html>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -