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

📄 author_booksave.asp

📁 功能介绍: 一、会员功能模块 1、站内短信发布(设计中) 2、书架收藏夹 3、发表评论(功能不完善) 4、申请作家(与添书员整合) 5、申请添书员(与作家整合) 6、申请更新员
💻 ASP
字号:
<!-- #include file="conn.asp" --><!--#include file="inc/config.asp"--><%
dim author_ID,author_name
author_ID=session("author_ID")
author_name=session("author_name")
If author_name="" or author_ID="" or IsNull(author_ID) Then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 可能您还没有登陆或者登陆超时 ');location.href='author_log.asp?info=out';</script>")
	Response.End
End If
set rs=server.createobject("adodb.recordset")
sql="select author_addpost,author_lock,author_UserID from [author] where author_ID="&author_ID&""
rs.open sql,conn,1,1
if rs.eof and rs.bof then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 用户不存在。');history.back();</script>")
	Response.end
End If
If rs("author_addpost")=0 Then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 您的驻站申请尚未被管理员通过 \n\n 请先联系本站站长或管理员通过您的申请 ');location.href='author_index.asp?info=index';</script>")
	Response.End
End If
If rs("author_lock")=1 Then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 您的驻站权限被锁定不能发表新作 \n\n 请先联系本站站长或管理员帮您解锁 ');location.href='author_index.asp?info=index';</script>")
	Response.End
End If
author_UserID=rs("author_UserID")
rs.close
set rs=nothing

Select Case request.querystring("info")
	Case "book_add"
		Call book_add()
	Case "book_edit"
		Call book_edit()
	Case "book_zhang_add"
		Call book_zhang_add()
	Case "book_zhang_edit"
		Call book_zhang_edit()
	Case "book_jie_add"
		Call book_jie_add()
	Case "book_jie_edit"
		Call book_jie_edit()
	Case "book_jjgg_edit"
		Call book_jjgg_edit()
	Case "view_go_cook_ok"
		Call view_go_cook_ok()
end select 

%>
<%
Sub book_add()
dim list_user,list_name,list_Adminid,list_all,list_news,pic,key
list_user=trim(request.Form("list_user"))
list_Adminid=author_ID
list_all=trim(request.Form("list_all"))
list_name=trim(request.Form("list_name"))
list_news=trim(request.Form("list_news"))
key=trim(request.Form("key"))
if request.Form("pic")="" then
pic="images/0.jpg"
Else
pic=trim(request.Form("pic"))
if len(pic) > 50 then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n最新图片中输入字符超限,请简短后重新输入仅(允许50字符,且不要输入中文)!');history.back(-1);</script>"
	response.end
end if
end if

if request.form("list_user")="" then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n作者不能为空!');history.back(-1);</script>"
	response.End()
end if

if request.form("list_name")="" then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n作品名称不能为空!');history.back(-1);</script>"
	response.End()
end if

if key="" then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n搜索关键字不能为空!');history.back(-1);</script>"
	response.end
end if

if list_all="" then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n介绍不能为空!');history.back(-1);</script>"
	response.end
end if

if len(list_news) > 800 then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n作品公告内容不能超过800字!');history.back(-1);</script>"
	response.end
end if

if len(list_all) > 1500 then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n作品介绍内容不能超过1500字!');history.back(-1);</script>"
	response.end
end if

set rsauth=server.createobject("adodb.recordset")
sql="select UserPoint from [Userinfo] where ID="&author_UserID&""
rsauth.open sql,conn,1,3
if rsauth.eof and rsauth.bof then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 用户不存在。');history.back();</script>")
	Response.end
End If

set rs=server.createobject("adodb.recordset")
sql="select * from list_book"
rs.open sql,conn,1,3
rs.addnew
rs("list_class")=trim(request.form("classid"))
rs("list_name")=trim(request.form("list_name"))
rs("list_pic")=pic
rs("list_lei")=trim(request.form("list_lei"))
rs("list_tai")=trim(request.form("list_tai"))
rs("laiyuan")="驻站作品"
rs("list_id")=0
rs("list_user")=list_user
rs("list_all")=trim(request.form("list_all"))
rs("list_news")=trim(request.form("list_news"))
rs("list_hit")=0
rs("list_jian")=0
rs("list_cang")=0
rs("list_sftai")=1
rs("list_qianyue")=trim(request.form("list_qianyue"))
rs("Isvip")=0
rs("Isgovip")=0
rs("IsgoVipAnswer")=""
rs("vip_bookid")=0
rs("IsGood")=0
rs("Islist_good")=0
rs("Isweb_good")=0
rs("Lock_book")=1
rs("Lock_lun")=0
rs("list_size")=1
rs("list_userid")=0
rs("list_Adminid")=list_Adminid
rs("list_abc")=trim(request.form("list_abc"))
rs("list_key")=trim(request.form("key"))
rs("listvv_good")=0
rs("list_yhit")=0
rs("list_mhit")=0
rs("list_zhit")=0
rs("list_dhit")=0
rs("list_yjian")=0
rs("list_mjian")=0
rs("list_zjian")=0
rs("list_djian")=0
rs.update
rs.close
set rs=nothing
rsauth("UserPoint")=rsauth("UserPoint")+authorbookadd
rsauth.update
rsauth.close
set rsauth=nothing
	response.write ("<script>alert('CnEndWeb(终点)提醒:\n\n发表成功,需要管理员验证通过后才能和本站读者见面\n\n 你现在可以先添加章节,以便管理员通过验证!');location.href='author_book.asp?info=book_list';</script>")
	response.end
end sub
%>

<%
sub book_jie_add()
b_id=request.form("list_bookid")
c_id=request.form("list_cookid")
	if request.form("subject")="" then
		response.write "<script>alert('CnEndWeb(终点)提醒:\n\n名称不能为空!');history.back(-1);</script>"
		response.end
	end if
	if request.form("message")="" then
		response.write "<script>alert('CnEndWeb(终点)提醒:\n\n内容不能为空!');history.back(-1);</script>"
		response.end
	end if
set rs4=server.CreateObject("ADODB.recordset")
sql4="select top 1 * from [list_view] where list_cookid="&c_id&" order by view_showid desc"
rs4.open sql4,conn,1,3
if rs4.eof and rs4.bof then
view_showid=1
else
view_showid=rs4("view_showid")+1
end if
	rs4.addnew
	rs4("view_type")=trim(request.form("subject"))
	rs4("view_size")=Len(trim(request.form("message")))
	rs4("view_ok")=""
	rs4("view_get")=1
	rs4("view_showid")=view_showid
	rs4("view_id")=b_id
	rs4("list_cookid")=c_id
	rs4("view_lock")=0
	rs4.update
	if IsSqlDataBase = 0 then
		view_size=rs4("view_size")
		id1=rs4("id")
	end if
	rs4.close
	if IsSqlDataBase = 1 then
	rs4.open sql4,conn,1,1
		view_size=rs4("view_size")
		id1=rs4("id")
	rs4.close
	end if
	set rs4=nothing
set rs4=server.createobject("adodb.recordset")
sql4="select id,view_ok,view_ok2,view_get,view_SaveToTXT from [list_view] Where id="&id1
	rs4.open sql4,conn,1,3
	if SaveToTXT=1 then
		BookViewPath="HTML/"&b_id&"/"

		If Not CreateMultiFolder(SiteSystemPath & BookViewPath) Then
			Response.Write "<br><font color='red'><B>创建TXT存放目录失败,可能是由于服务器限制!!</B></font>"&SiteSystemPath & BookViewPath&"<br>"
			rs4("view_SaveToTXT")=0
			rs4("view_ok2")=htmlencode(request.form("message"))
			rs4.update
		Else
			file=server.mappath( SiteSystemPath & BookViewPath&id1&".TXT" )
			view_view_ok="document.write('"
			view_view_ok=view_view_ok&""&htmlencode(request.form("message"))&""
			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
			rs4("view_SaveToTXT")=1
			rs4("view_ok")="/"&BookViewPath&strFileName&id1&".TXT"
			rs4("view_ok2")=" "
			rs4.update
		end if
	else
		rs4("view_SaveToTXT")=0
		rs4("view_ok2")=htmlencode(request.form("message"))
		rs4.update
	end if
rs4.close
set rs4=nothing

set rs=server.CreateObject("adodb.recordset")
sql="select list_cookname from [list_cook] where list_cookid="&c_id
rs.open sql,conn,1,1
list_cookname=rs("list_cookname")
rs.close
set rs=nothing

		newviewname=list_cookname&"&nbsp;"&trim(request.form("subject"))
		set rs_u=server.createobject("adodb.recordset")
		sql="select newviewid,newviewname,newview,list_size,list_gxdate from [list_book] where id="&b_id&""
		rs_u.open sql,conn,1,3
			rs_u("newviewid")=id1
			rs_u("newviewname")=newviewname
			rs_u("newview")=left(htmlencode(request.form("message")),399)
			rs_u("list_gxdate")=now()
			rs_u("list_size")=rs_u("list_size")+view_size
			rs_u.update
		rs_u.close
		set rs_u=nothing


	set rsauth=server.createobject("adodb.recordset")
	sql="select UserPoint from [Userinfo] where ID="&author_UserID&""
	rsauth.open sql,conn,1,3
	if rsauth.eof and rsauth.bof then
		Response.Write ("<br><font color='red'><B>在会员列表中找不到该驻站作家的资料,无法增加积分。</B></font>")
	Else
		rsauth("UserPoint")=rsauth("UserPoint")+authorbookjieadd
		rsauth.update
	End If
	rsauth.close
	set rsauth=nothing
	
if makehtml=1 then
MakeViewHtml(id1)
MakeindexHtml(b_id)
end if
if makeJS=1 then
temzxgx(zxgxNum)
end if
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n作品章节添加成功!');location.href='author_book.asp?info=jie_add&id="&c_id&"';</script>"
	response.end
end sub
%>

<%
sub book_jie_edit()

end sub
%>

<%
sub book_zhang_add()
if request.form("list_cookname")="" then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n分卷名称不能为空!');history.back(-1);</script>"
	response.end
end if
b_id=request.form("b_id")
set rs=server.createobject("adodb.recordset")
sql="select list_Adminid from [list_book] where id="&b_id
rs.open sql,conn,1,1
if rs("list_Adminid")<>author_ID then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 你没有权限管理该作品。');history.back();</script>")
	Response.end
End If
rs.close
set rs=nothing
set rs3=server.createobject("adodb.recordset")
sql3="select list_cookname,list_bookid from [list_cook]"
rs3.open sql3,conn,1,3
rs3.addnew
rs3("list_cookname")=trim(request.form("list_cookname"))
rs3("list_bookid")=b_id
rs3.update
rs3.close
set rs3=nothing
response.write "<script>alert('CnEndWeb(终点)提醒:\n\n 分卷添加成功!');location.href='author_book.asp?info=zhang_list&id="&b_id&"';</script>"
response.end
end sub
%>
<%
sub book_zhang_edit()
if request.form("list_cookname")="" then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n 分卷名称不能为空!');history.back(-1);</script>"
	response.end
end if
id=CheckSql(request.form("id"))
CheckSqlnum(id)
id=int(id)
set rs=server.CreateObject("ADODB.recordset")
sql="select list_cookname,list_bookid from [list_cook] where list_cookid="&id
rs.open sql,conn,1,3
b_id=rs("list_bookid")
set rs3=server.createobject("adodb.recordset")
sql3="select list_Adminid from [list_book] where id="&b_id
rs3.open sql3,conn,1,1
if rs3("list_Adminid")<>author_ID then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 你没有权限管理该作品。');history.back();</script>")
	Response.end
End If
rs3.close
set rs3=nothing

rs("list_cookname")=trim(request.form("list_cookname"))
rs.update
rs.close
set rs=nothing
response.write ("<script>alert('CnEndWeb(终点)提醒:\n\n 分卷名称修改成功!');history.back(-1);</script>")
response.end
end sub
%>
<%
sub book_jjgg_edit()
id=CheckSql(request.form("id"))
CheckSqlnum(id)
id=int(id)
list_all=trim(request.Form("list_all"))
list_news=trim(request.Form("list_news"))
if list_all="" then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n介绍不能为空!');history.back(-1);</script>"
	response.end
end if

if len(list_all) > 1500 then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n介绍内容不能超过1500字!');history.back(-1);</script>"
	response.end
end if
if list_news="" then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n公告不能为空!');history.back(-1);</script>"
	response.end
end if

if len(list_news) > 1500 then
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n公告内容不能超过1500字!');history.back(-1);</script>"
	response.end
end if
set rsab=server.createobject("adodb.recordset")
sqlab="select list_all,list_news,list_Adminid from [list_book] where id="&id
rsab.open sqlab,conn,1,3
if rsab("list_Adminid")<>author_ID then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 你没有权限管理该作品。');history.back();</script>")
	Response.end
End If

rsab("list_all")=list_all
rsab("list_news")=list_news
rsab.update
rsab.close
set rsab=nothing
if makehtml=1 then
MakelookHtml(id)
end if
	response.write "<script>alert('CnEndWeb(终点)提醒:\n\n作品公告和介绍修改成功!');location.href='author_book.asp?info=jjgg_edit&id="&id&"';</script>"
	Response.end
end sub
%>

<%
sub view_go_cook_ok()
ID=trim(request("id"))
list_cookid=trim(request("list_cookid"))
b_id=CheckSql(request.form("b_id"))
CheckSqlnum(b_id)
b_id=int(b_id)
set rs3=server.createobject("adodb.recordset")
sql3="select list_Adminid from [list_book] where id="&b_id
rs3.open sql3,conn,1,1
if rs3("list_Adminid")<>author_ID then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 你没有权限管理该作品。');history.back();</script>")
	Response.end
End If
rs3.close
set rs3=nothing

If ID="" Then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 您至少需要选择一个章节');javascript:window.close();</SCRIPT>")
	Response.end
End If
If list_cookid="" Then
	Response.Write ("<script>alert('CnEndWeb(终点)提醒:\n\n 您需要选择一个分卷');javascript:window.close();</SCRIPT>")
	Response.end
End If

'创建排列顺序
viewArray=Split(ID, ",")
Num = UBound(viewArray)

set rs=server.createobject("adodb.recordset")

For i=0 To Num
	sql="select id,list_cookid from [list_view] where id ="&viewArray(i)
	rs.open sql,conn,1,3
	If not rs.eof Then
		rs("list_cookid")=list_cookid
		rs.Update
	End If
	rs.close
Next
%>
<script>
function iftime(){
setTimeout("close()",2000);
}
opener.location.reload();
</script>
</head>

<body  onLoad="iftime()"  style="background-color:buttonface;border:none;margin-top:7px">
<br><br><br><br><br><br><br><br><fieldset style='width:250; height:65' align=center class=zt><legend>&nbsp;提示信息&nbsp;</legend><div align=center><p> CnEndWeb(终点)提醒: 操作成功!<br><p><a href='javascript:window.close();'>关闭窗口</a>,或五秒后自动关闭<br><br></fieldset>

</body>
<%
set rs=nothing
end sub
%>

⌨️ 快捷键说明

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