⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_works.asp

📁 小说站源代码文件
💻 ASP
📖 第 1 页 / 共 5 页
字号:
page=request.querystring("page")
set rsu=server.CreateObject("ADODB.recordset")
sqlu="select UserGrade from userinfo where ID="&userid&""
rsu.open sqlu,conn,1,3
if not(rsu.eof and rsu.bof) then
rsu("UserGrade")=rsu("UserGrade")-1
rsu.update
rsu.close
set rsu=nothing
end if
	set rsfile=server.createobject("adodb.recordset") 
	strSQL ="select fileurl_name,fileurl_path from filetest where fileurl_class=2 and fileurl_fileID ="&Ar_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 ="&Ar_id&""
	conn.execute "delete from Article where Ar_id = "&Ar_id&""
call connclose() 
if urltype="list" then
	cndb=request.querystring("cndb")
	if cndb="" then
		cndb="all"
	end if
	Call ShowAdminSuccessMsg("<li> 短篇文章附件已全部清理!</li><br><li>短篇作品删除成功!</li><br>","admin_article.asp?info=list&cndb="&cndb&"&page="&page&"")
elseif urltype="search" then
	key_keyword=request.querystring("key_keyword")
	key_type=request.querystring("key_type")
	Call ShowAdminSuccessMsg("<li> 短篇文章附件已全部清理!</li><br><li>短篇作品删除成功!</li><br>","admin_booksearch.asp?key_type="&key_type&"&key_keyword="&key_keyword&"&page="&page&"")
else
	Call ShowAdminSuccessMsg("<li> 短篇文章附件已全部清理!</li><br><li>短篇作品删除成功!</li><br>","admin_article.asp?info=list&cndb=all&page="&page&"")
end if
end sub
'——————————
sub article_list()
id=trim(request("checked"))
docndb=request.querystring("docndb")
If ID="" Then
	ErrCodes = ErrCodes & "<li>您至少需要选择一部作品!</li><br>"
	FoundErr=True
End If
if FoundErr=True then
	Call ShowAdminErrMsg(ErrCodes,"javascript:window.close()")
else
	viewArray=Split(ID, ",")
	Num = UBound(viewArray)
	if docndb="删除" then
		For i=0 To Num
		set rs=server.CreateObject("ADODB.recordset")
		sql="select Ar_userid from Article where Ar_id="&viewArray(i)&""
		rs.open sql,conn,1,1
		if not(rs.eof and rs.bof) then
			set rsu=server.CreateObject("ADODB.recordset")
			sqlu="select UserGrade from userinfo where ID="&rs("Ar_userid")&""
			rsu.open sqlu,conn,1,3
			if not(rsu.eof and rsu.bof) then
				rsu("UserGrade")=rsu("UserGrade")-1
				rsu.update
			end if
			rsu.close
			set rsu=nothing
		end if
		rs.close
		set rs=nothing
		set rsfile=server.createobject("adodb.recordset") 
		strSQL ="select fileurl_name,fileurl_path from filetest where fileurl_class=2 and fileurl_fileID ="&viewArray(i)&""
		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 ="&viewArray(i)&""
		conn.execute "delete from Article where Ar_id = "&viewArray(i)&""
		Next
		Success = Success & "<li>短篇文章删除操作成功!</li><br>"
	elseif docndb="通过审核" then
		For i=0 To Num
			conn.execute ("update Article set Ar_Lock=0 where Ar_id="&viewArray(i))
		Next
		Success = "<li>短篇文章已全部通过审核!</li><br>"
	elseif docndb="取消审核" then
		For i=0 To Num
			conn.execute ("update Article set Ar_Lock=1 where Ar_id="&viewArray(i))
		Next
		Success = "<li>短篇文章已全部取消审核!</li><br>"
	else
		Success = "<li>没有操作完成!</li><br>"
	end if
call connclose() 
response.write ("<script>opener.location.reload();</script>")
Call ShowAdminSuccessMsg(Success,"javascript:window.close()")
end if
end sub
'——————————
sub book_add()
dim list_user,list_userid,list_Adminid,list_all,list_news,pic,key
list_user=GetTextFromHtml(trim(request.Form("list_user")))
list_all=GetTextFrHtml(trim(request.Form("list_all")))
list_news=GetTextFrHtml(trim(request.Form("list_news")))
key=GetTextFromHtml(request.Form("key"))
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 or IsSqlDataBase = 2 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
list_userid=request.Form("list_userid")
if list_userid="" then
	list_userid=0
Elseif list_userid=0 then
else
	if IsNumeric(list_userid)=false then
		ErrCodes = ErrCodes & "<li>您输入的作品更新员ID无效,请查询后输入或留空!</li><br>"
		FoundErr=True
	end if
	set rs_u=server.createobject("adodb.recordset")
	sql_u="select id from userinfo where ID="&int(list_userid)
	rs_u.open sql_u,conn,1,1
	if rs_u.bof and rs_u.eof then
		ErrCodes = ErrCodes & "<li>您输入的作品更新员ID无效,请查询后输入或留空!</li><br>"
		FoundErr=True 
	else
		list_userid=int(list_userid)
	end if
	rs_u.close
	set rs_u=nothing
end if
list_Adminid=request.Form("list_Adminid")
if list_Adminid="" then
	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="&int(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("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_news) > 800 then
	ErrCodes = ErrCodes & "<li>作品公告内容不能超过800字!</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 list_name='"&GetTextFromHtml(trim(request.form("list_name")))&"' order by id desc"
rs.open sql,conn,1,3
	rs.addnew
	rs("list_class")=request.form("classid")
	rs("list_name")=GetTextFromHtml(trim(request.form("list_name")))
	rs("list_pic")=pic
	rs("list_lei")=request.form("list_lei")
	rs("list_tai")=request.form("list_tai")
	rs("laiyuan")=request.form("laiyuan")
	rs("list_id")=0
	rs("list_key")=key
	rs("list_user")=list_user
	rs("list_all")=list_all
	rs("list_news")=list_news
	rs("list_hit")=0
	rs("list_jian")=0
	rs("list_cang")=0
	rs("list_sftai")=trim(request.form("list_sftai"))
	rs("list_qianyue")=trim(request.form("list_qianyue"))
	rs("list_gxdate")=now()
	rs("list_date")=now()
	rs("Isgovip")=0
	rs("IsgoVipAnswer")=""
	rs("vip_bookid")=0
	rs("Lock_book")=trim(request.form("Lock_book"))
	rs("Lock_lun")=trim(request.form("Lock_lun"))
	rs("IsVip")=trim(request.form("IsVip"))
	rs("isuserread")=request.form("isuserread")
	rs("list_size")=1
	rs("list_userid")=list_userid
	rs("list_Adminid")=list_Adminid
	rs("list_abc")=list_abc
	rs("yearhitstime")=now()
	rs("monthhitstime")=now()
	rs("weekdayhitstime")=now()
	rs("dayhitstime")=now()
	rs("list_yhit")=0
	rs("list_mhit")=0
	rs("list_zhit")=0
	rs("list_dhit")=0
	rs("yearjiantime")=now()
	rs("monthjiantime")=now()
	rs("weekdayjiantime")=now()
	rs("dayjiantime")=now()
	rs("list_yjian")=0
	rs("list_mjian")=0
	rs("list_zjian")=0
	rs("list_djian")=0
	rs.update
	rs.close
	rs.open sql,conn,1,1
		id=rs("id")
	rs.close
Set Rs=Nothing

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
	if request.form("IsVip")=1 then
	temvipzxgx(vipzxgxNum)
else
	temzxgx(zxgxNum)
end if
if request.form("IsGood")=1 then
	temjptj(jptjNum)
end if
if request.form("Islist_good")=1 then
	temlztj(lztjNum)
end if
if request.form("Isweb_good")=1 then
	temsyft(syftNum)
end if
if request.form("listvv_good")=1 then
	temqltj(qltjNum)
end if
	temadd(addNum)
end if
call connclose() 
Call ShowAdminSuccessMsg("<li>长篇作品添加成功!下面将返回作品列表,点击作品名称继续下一步操作!</li><br>","admin_book.asp?info=booklist&cndb=all")
end if
end sub
'——————————
sub book_edit()
id=CheckSql(request.querystring("id"))
CheckSqlnum(id)
id=int(id)
urltype=request.querystring("urltype")
page=request.querystring("page")

list_user=GetTextFromHtml(request.Form("list_user"))
list_all=GetTextFrHtml(request.Form("list_all"))
list_news=GetTextFrHtml(request.Form("list_news"))
key=GetTextFromHtml(request.Form("key"))
list_userid=request.Form("list_userid")
if list_userid="" then
	list_userid=0
Elseif list_userid=0 then
else
	if IsNumeric(list_userid)=false then
		ErrCodes = ErrCodes & "<li>您输入的作品更新员ID无效,请查询后输入或留空!</li><br>"
		FoundErr=True
	end if
	set rs_u=server.createobject("adodb.recordset")
	sql_u="select ID from userinfo where ID="&list_userid
	rs_u.open sql_u,conn,1,1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -