📄 admin_works.asp
字号:
list_Adminid=0
Elseif list_Adminid=0 then
Else
if IsNumeric(list_Adminid)=false then
ErrCodes = ErrCodes & "<li>您输入的作品管理员ID无效,请查询后输入或留空!</li><br>"
FoundErr=True
end if
set rs_a=server.createobject("adodb.recordset")
sql_a="select Author_ID from [author] where Author_ID="&list_Adminid
rs_a.open sql_a,conn,1,1
if rs_a.bof and rs_a.eof then
ErrCodes = ErrCodes & "<li>您输入的作品管理员ID无效,请查询后输入或留空!</li><br>"
FoundErr=True
else
list_Adminid=int(list_Adminid)
end if
rs_a.close
set rs_a=nothing
end if
if request.Form("pic")="" then
pic="images/0.jpg"
Else
pic=trim(request.Form("pic"))
if len(pic) > 255 then
ErrCodes = ErrCodes & "<li>最新图片中输入字符超限,请简短后重新输入仅(允许255字符,且不要输入中文)!</li><br>"
FoundErr=True
end if
picload=False
if request.Form("list_loadpic")="True" then
If Left(Lcase(pic),7)="http://" Then
fileExt=split(pic,".")
imgsExt=fileExt(ubound(fileExt)) '获取图片后缀
randomize
ranNum=int(90000*rnd)+10000
Filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&imgsExt
If SaveRemoteFile(SiteSystemPath &"BookFace/"& FileName,pic,pic)=True Then
If not CheckFileType(Server.mappath(SiteSystemPath &"BookFace/"& FileName)) then
file1=SiteSystemPath &"BookFace/"& FileName
FSOFiledel(file1)
pic="images/0.jpg"
else
set rsfile=server.createobject("adodb.recordset")
strSQL ="select id,fileurl_info,fileurl_name,fileurl_user,fileurl_size,fileurl_path,fileurl_class,fileurl_Types from [filetest] where fileurl_class=3 and fileurl_name='"&FileName&"' order by id desc"
rsfile.open strSQL,conn,1,3
rsfile.addnew
rsfile("fileurl_name")=FileName
rsfile("fileurl_info")=pic
rsfile("fileurl_user")="管理员:"&request.cookies("CnendWeb")("admininfo_loginname")
rsfile("fileurl_size")=Getfilesize(SiteSystemPath &"BookFace/"& FileName)
rsfile("fileurl_path")=SiteSystemPath &"BookFace/"
rsfile("fileurl_class")=3
rsfile("fileurl_Types")=imgsExt
rsfile.update
if IsSqlDataBase = 0 then
attachid=rsfile("id")
end if
rsfile.close
if IsSqlDataBase = 1 then
rsfile.open strSQL,conn,1,1
attachid=rsfile("id")
rsfile.close
end if
set rsfile=nothing
picload=True
pic=SiteSystemPath &"BookFace/"& FileName
End If
End If
End If
End If
End If
if request.form("list_abc")="9" or request.form("list_abc")="" then
list_abc=GetSpellChar(trim(request.form("list_name")))
else
list_abc=trim(request.form("list_abc"))
end if
list_wordnum=Getwordnum(trim(request.form("list_name")))
if request.form("list_lei")="" then
ErrCodes = ErrCodes & "<li>二级分类不能为空,请先添加二级分类!</li><br>"
FoundErr=True
end if
if request.form("list_name")="" then
ErrCodes = ErrCodes & "<li> 作品名称不能为空!</li><br>"
FoundErr=True
end if
if list_user="" then
ErrCodes = ErrCodes & "<li> 作品作者不能为空!</li><br>"
FoundErr=True
end if
if key="" then
ErrCodes = ErrCodes & "<li>搜索关键字不能为空!</li><br>"
FoundErr=True
end if
if list_all="" then
ErrCodes = ErrCodes & "<li> 介绍不能为空!</li><br>"
FoundErr=True
end if
if len(list_all) > 1500 then
ErrCodes = ErrCodes & "<li>作品介绍内容不能超过1500字!</li><br>"
FoundErr=True
end if
if FoundErr=True then
Call ShowAdminErrMsg(ErrCodes,"javascript:history.go(-1)")
else
set rs=server.createobject("adodb.recordset")
sql="select * from [list_book] where id="&id
rs.open sql,conn,1,3
rs("list_class")=trim(request.form("classid"))
rs("list_name")=GetTextFromHtml(request.form("list_name"))
rs("list_lei")=trim(request.form("list_lei"))
rs("list_tai")=trim(request.form("list_tai"))
rs("laiyuan")=trim(request.form("laiyuan"))
rs("list_key")=key
rs("list_user")=list_user
rs("list_all")=list_all
rs("list_news")=list_news
rs("list_sftai")=trim(request.form("list_sftai"))
rs("list_qianyue")=trim(request.form("list_qianyue"))
rs("list_gxdate")=now()
rs("IsGood")=trim(request.form("IsGood"))
rs("Islist_good")=trim(request.form("Islist_good"))
rs("Isweb_good")=trim(request.form("Isweb_good"))
rs("Lock_book")=trim(request.form("Lock_book"))
rs("Lock_lun")=trim(request.form("Lock_lun"))
rs("IsVip")=trim(request.form("IsVip"))
rs("list_userid")=list_userid
rs("list_Adminid")=list_Adminid
rs("isuserread")=request.form("isuserread")
rs("list_abc")=list_abc
rs("listvv_good")=request.form("listvv_good")
rs.update
if IsSqlDataBase = 0 then
id=rs("id")
oldpic=rs("list_pic")
rs("list_pic")=pic
rs.update
end if
rs.close
if IsSqlDataBase = 1 then
rs.open sql,conn,1,3
id=rs("id")
oldpic=rs("list_pic")
rs("list_pic")=pic
rs.update
rs.close
end if
set rs=nothing
if oldpic<>"" and oldpic<>"images/0.jpg" and oldpic<>pic then
If Left(Lcase(oldpic),7)<>"http://" Then
set rs=server.createobject("adodb.recordset")
sql="select fileurl_name,fileurl_fileID from [filetest] where fileurl_fileID="&ID&" and fileurl_class=3 order by id desc"
rs.open sql,conn,1,2
if not(rs.eof and rs.bof) then
if Instr(oldpic,rs("fileurl_name"))> 0 then
rs("fileurl_fileID")=0
rs.update
end if
end if
Rs.Close
Set Rs=Nothing
end if
end if
if picload=True and attachid<>"" then
conn.execute ("update [filetest] set fileurl_fileID="&ID&" where id="&attachid)
end if
if request.form("attach")<>"" then
attachArray=Split(request.form("attach"),";")
For i1=0 To Ubound(attachArray)-1
attachid=CheckSql(Replace(Replace(attachArray(i1),"[attach]",""),"[/attach]",""))
CheckSqlnum(attachid)
set rs=server.createobject("adodb.recordset")
sql="select fileurl_name from [filetest] where id="&attachid&" order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
else
if Instr(pic,rs("fileurl_name"))> 0 then
conn.execute ("update [filetest] set fileurl_fileID="&ID&" where id="&attachid)
end if
end if
Rs.Close
Set Rs=Nothing
Next
end if
if makehtml=1 then
MakelookHtml(id)
end if
if makeJS=1 then
temzxgx(zxgxNum)
end if
call connclose()
if urltype="list" then
cndb=request.querystring("cndb")
clid=request.querystring("clid")
if cndb="" then
cndb="all"
end if
Call ShowAdminSuccessMsg("<li>作品修改成功!</li><br>","admin_book.asp?info=booklist&cndb="&cndb&"&clid="&clid&"&page="&page&"")
elseif urltype="search" then
key_keyword=request.querystring("key_keyword")
key_type=request.querystring("key_type")
Call ShowAdminSuccessMsg("<li>作品修改成功!</li><br>","admin_booksearch.asp?key_type="&key_type&"&key_keyword="&key_keyword&"&page="&page&"")
elseif urltype="listjian" then
cndb=request.querystring("cndb")
if cndb="" then
cndb="jingpin"
end if
Call ShowAdminSuccessMsg("<li>作品修改成功!</li><br>","admin_bookjian.asp?info="&cndb&"&page="&page&"")
else
Call ShowAdminSuccessMsg("<li>作品修改成功!</li><br>","admin_book.asp?info=booklist&cndb=all&clid="&clid&"&page="&page&"")
end if
end if
end sub
'——————————
sub book_del()
id=CheckSql(request.querystring("id"))
CheckSqlnum(id)
id=int(id)
urltype=request.querystring("urltype")
page=request.querystring("page")
set rsfile=server.createobject("adodb.recordset")
strSQL ="select fileurl_name,fileurl_path from [filetest] where fileurl_class=3 and fileurl_fileID ="&id&""
rsfile.open strSQL,conn,1,1
if not(rsfile.eof and rsfile.bof) then
do while not rsfile.eof
file1=rsfile("fileurl_path")&rsfile("fileurl_name")
FSOFiledel(file1)
rsfile.movenext
loop
end if
rsfile.close
set rsfile=nothing
conn.execute"delete from [filetest] where ID ="&id&""
viewFolder = SiteSystemPath&"HTML/"&id&"/"
set rsco=server.createobject("adodb.recordset")
sql="select id,list_cookid from [list_view] where view_id="&id&""
rsco.open sql,conn,1,1
if rsco.eof and rsco.bof then
else
do while not rsco.eof
id1=rsco("id")
cook_id=rsco("list_cookid")
set rsfile=server.createobject("adodb.recordset")
strSQL ="select fileurl_name,fileurl_path from [filetest] where fileurl_class=1 and fileurl_fileID ="&id1&""
rsfile.open strSQL,conn,1,1
if not(rsfile.eof and rsfile.bof) then
do while not rsfile.eof
file1=rsfile("fileurl_path")&rsfile("fileurl_name")
FSOFiledel(file1)
rsfile.movenext
loop
end if
rsfile.close
set rsfile=nothing
conn.execute"delete from [filetest] where ID ="&id1&""
file3=viewFolder&"Z"&cook_id&"."&htmlphe&""
file2=viewFolder&id1&"."&htmlphe&""
file1=viewFolder&id1&".TXT"
FSOFiledel(file3)
FSOFiledel(file2)
FSOFiledel(file1)
rsco.movenext
loop
end if
rsco.close
set rsco=nothing
Success = Success & "<li> 作品章节附件已全部清理!</li><br>"
Success = Success & "<li> 作品章节静态页面已全部清理!</li><br>"
Success = Success & "<li> 作品分卷静态页面已全部清理!</li><br>"
file4=viewFolder&"Allbook"&id&"."&htmlphe&""
file5=SiteSystemPath&id&"."&htmlphe&""
file6=viewFolder&"index."&htmlphe&""
FSOFiledel(file4)
FSOFiledel(file5)
FSOFiledel(file6)
Success = Success & "<li> 作品资料静态页面已清理!</li><br>"
Success = Success & "<li> 作品全文静态页面已清理!</li><br>"
Success = Success & "<li> 作品目录静态页面已清理!</li><br>"
conn.execute "delete from [list_view] where view_id in ("&id&") "
conn.execute "delete from [list_cook] where list_bookid in ("&id&") "
conn.execute "delete from [Comment] where commenttype=1 and type_id in ("&id&") "
conn.execute "delete from [list_book] where id in ("&id&") "
call connclose()
if urltype="list" then
cndb=request.querystring("cndb")
clid=request.querystring("clid")
if cndb="" then
cndb="all"
end if
Call ShowAdminSuccessMsg(Success & "<li> 作品删除成功!</li><br>","admin_book.asp?info=booklist&cndb="&cndb&"&clid="&clid&"&page="&page&"")
elseif urltype="search" then
key_keyword=request.querystring("key_keyword")
key_type=request.querystring("key_type")
Call ShowAdminSuccessMsg(Success & "<li> 作品删除成功!</li><br>","admin_booksearch.asp?key_type="&key_type&"&key_keyword="&key_keyword&"&page="&page&"")
elseif urltype="listjian" then
cndb=request.querystring("cndb")
if cndb="" then
cndb="jingpin"
end if
Call ShowAdminSuccessMsg(Success & "<li> 作品删除成功!</li><br>","admin_bookjian.asp?info="&cndb&"&page="&page&"")
else
Call ShowAdminSuccessMsg(Success & "<li> 作品删除成功!</li><br>","admin_book.asp?info=booklist&cndb=all&clid="&clid&"&page="&page&"")
end if
end sub
'——————————
sub book_zhang_add()
if request.form("list_cookname")="" then
ErrCodes = ErrCodes & "<li> 分卷名称不能为空!</li><br>"
FoundErr=True
end if
if FoundErr=True then
Call ShowAdminErrMsg(ErrCodes,"javascript:history.go(-1)")
else
dim b_id,classid
b_id=request.form("b_id")
set rs=server.CreateObject("adodb.recordset")
sql="select list_class from [list_book] where id="&b_id
rs.open sql,conn,1,1
classid=rs("list_class")
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select top 1 * from [list_cook] where list_bookid="&b_id&" order by list_cookid desc"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
cook_viewid=1
else
cook_viewid=rs("cook_viewid")+1
end if
rs.addnew
rs("list_cookname")=GetTextFromHtml(trim(request.form("list_cookname")))
rs("list_cookinfo")=GetTextFrHtml(htmlencode(request.form("list_cookinfo")))
rs("list_bookid")=b_id
rs("classid")=classid
rs("cook_viewid")=cook_viewid
rs.update
rs.close
set rs=nothing
call connclose()
Call ShowAdminSuccessMsg("<li>分卷添加成功!</li><br>","admin_book.asp?info=zhanglist&b_id="&b_id&"")
end if
end sub
'——————————
sub book_zhang_edit()
if request.form("list_cookname")="" then
ErrCodes = ErrCodes & "<li> 分卷名称不能为空!</li><br>"
FoundErr=True
end if
if FoundErr=True then
Call ShowAdminErrMsg(ErrCodes,"javascript:history.go(-1)")
else
dim b_id,c_id
b_id=CheckSql(request.form("b_id"))
CheckSqlnum(b_id)
b_id=int(b_id)
c_id=CheckSql(request.form("c_id"))
CheckSqlnum(c_id)
c_id=int(c_id)
set rs=server.createobject("adodb.recordset")
sql="select * from [list_cook] where list_cookid="&c_id
rs.open sql,conn,1,3
rs("list_cookname")=GetTextFromHtml(trim(request.form("list_cookname")))
rs("list_cookinfo")=GetTextFrHtml(htmlencode(request.form("list_cookinfo")))
rs.update
rs.close
set rs=nothing
call connclose()
Call ShowAdminSuccessMsg("<li>分卷名称修改成功!</li><br>","admin_book.asp?info=zhanglist&b_id="&b_id&"")
end if
end sub
'——————————
sub book_zhang_del()
b_id=CheckSql(request.querystring("b_id"))
CheckSqlnum(b_id)
b_id=int(b_id)
c_id=CheckSql(request.querystring("c_id"))
CheckSqlnum(c_id)
c_id=int(c_id)
page=replace(trim(request("page")),"'","")
conn.execute "delete from [list_cook] where list_cookid in ("&c_id&") "
viewFolder = SiteSystemPath&"HTML/"&b_id&"/"
file1=viewFolder&"Z"&c_id&"."&htmlphe&""
FSOFiledel(file1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -