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

📄 user_article.asp

📁 淘客网上商店网站程序 淘客网上商店网站程序 淘客网上商店网站程序
💻 ASP
📖 第 1 页 / 共 5 页
字号:
function ChkReceiver(){
if (document.getElementById('Receive').checked == true) {
	document.getElementById('ShowReceiver').style.display = '';
}else{
	document.getElementById('ShowReceiver').style.display = 'none';
}
}
function ChkLink(){
if (document.getElementById('IsLink').checked == true) {
	document.getElementById('ChkIsLink').style.display = '';
	document.getElementById('ChkNoLink').style.display = 'none';
}else{
	document.getElementById('ChkIsLink').style.display = 'none';
	document.getElementById('ChkNoLink').style.display = '';
}
}
//-->
</script>
<%
End Sub

Sub DoSaveRecord()
	FoundErr		= false
	InfoID			= Cl.GetClng(Request.Form("InfoID"))
	ClassID			= Cl.GetClng(request.form("ClassID"))
	SpecialID		= Trim(request.Form("SpecialID"))
	Title			= Trim(request.form("Title"))
	Prefixion		= Trim(request.form("Prefixion"))
	TitleIntact		= Trim(request.form("TitleIntact"))
	FontColor		= Trim(request.form("FontColor"))
	FontType		= Cl.GetClng(request.form("FontType"))
	Keyword			= Trim(request.form("Keyword"))
	Content			= Trim(request.form("Content"))
	AuthorName		= Trim(request.form("AuthorName"))
	AuthorEmail		= Trim(request.form("AuthorEmail"))
	CopyFromName	= Trim(request.form("CopyFromName"))
	CopyFromUrl		= Trim(request.form("CopyFromUrl"))
	UpdateTime		= Trim(request.form("UpdateTime"))
	PicUrl			= Trim(request.form("PicUrl"))
	Passed			= Trim(request.form("Passed"))
	NowCreate		= Trim(request.form("NowCreate"))
	OnTop			= Trim(request.form("OnTop"))
	Hot				= Trim(request.form("Hot"))
	Elite			= Trim(request.form("Elite"))
	Hits			= Cl.GetClng(request.form("Hits"))
	PaginationType	= Cl.GetClng(request.form("PaginationType"))
	MaxCharPerPage	= Cl.GetClng(request.form("MaxCharPerPage"))
	InfoGroup		= Trim(request.form("InfoGroup"))
	InfoPoint		= Cl.GetClng(request.form("InfoPoint"))
	InfoMoney		= Cl.GetClng(request.form("InfoMoney"))
	Stars			= Cl.GetClng(request.form("Stars"))
	BackPoint		= Cl.GetClng(request.form("BackPoint"))
	BackPointRate	= Cl.GetClng(request.form("BackPointRate"))
	BackMoney		= Cl.GetClng(request.form("BackMoney"))
	BackMoneyRate	= Cl.GetClng(request.form("BackMoneyRate"))
	Receive			= Trim(request.form("Receive"))
	ReceiveUser		= Trim(request.form("ReceiveUser"))
	AutoReceiveTime	= Trim(request.form("AutoReceiveTime"))
	ReceiveType		= Trim(request.form("ReceiveType"))
	Intro			= Trim(request.form("Intro"))
	IsLink			= Trim(request.form("IsLink"))
	HtmlFileUrl			= Trim(request.form("HtmlFileUrl"))
	UploadFiles		= Trim(request.form("UploadFiles"))
	Editor			= Cl.MemberName
	if ClassID<=0 then
		founderr=true
		errmsg=errmsg & "<br /><li>未指定文章所属栏目或者指定的栏目有下属子栏目</li>"
	end if
	if Title="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>文章标题不能为空</li>"
	end if
	if KeyWord="" then
		founderr=true
		errmsg=errmsg & "<br /><li>请输入文章关键字</li>"
	end if
	if IsLink="yes" then
		if HtmlFileUrl="" then
			founderr=true
			errmsg=errmsg & "<br /><li>链接地址不能为空</li>"
		end if
	else
		if Content="" then
			founderr=true
			errmsg=errmsg & "<br /><li>文章内容不能为空</li>"
		end if
	end if
	if FoundErr=True then Cl.ShowErr(ErrMsg)
	set tClass=Cl.Execute("select ClassName,Depth,ParentID,ParentPath,Child,ClassMaster,BrowsePurview,DisabledAdd,AddPoint,AddIsChk,MaxLimit,IsOuter From Cl_Class where ClassID=" & ClassID)
	if tClass.bof and tClass.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>找不到指定的栏目</li>"
	else
		if tClass(11)=1 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br /><li>不能指定外部栏目</li>"
		elseif tClass(7)<>0 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br /><li>对不起,此栏目禁止添加资料</li>"
		else
			ClassName	= tClass(0) : Depth		= tClass(1)
			ParentID	= tClass(2) : ParentPath= tClass(3)
			Child		= tClass(4) : ClassMaster= tClass(5)
			sAddPoint	= tClass(8) : sAddIsChk	= tClass(9)
			sMaxLimit	= tClass(10)
			if request("GetClassPurview")="yes" then InfoGroup="5"
		end if
	end if
	tClass.Close :Set tClass=Nothing
	'简介和标题过滤脏话
	if Intro="" then
		Intro="暂无简介"
	else
		Intro=Cl.ChkBadWords(Intro)
	end if
	Title		= Cl.ChkBadWords(Title)
	TitleIntact	= Cl.ChkBadWords(TitleIntact)
	if Content<>"" then
		if Cl.strLength(Content)>sMaxLimit and sMaxLimit<>0 then
			founderr=true
			errmsg=errmsg & "<br /><li>文章内容大小超过了最大限制("&sMaxLimit&" 字节!)</li>"
		end if
		dim strSiteUrl
		strSiteUrl=request.ServerVariables("HTTP_REFERER")
		strSiteUrl=lcase(left(strSiteUrl,instrrev(strSiteUrl,"$")))
		Content=replace(Content,strSiteUrl,"")
		if Cl.Web_Setting(4)="Yes" then  '开启脏话过滤
			Content=Cl.ChkBadWords(Content)
		end if
		if Trim(Cl.Web_Setting(9))="Yes" then
			Content=Cl.DeCode(Content,Trim(Cl.Web_Setting(10)))
		end if
	end if
	if PaginationType=1 and MaxCharPerPage=0 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>请指定自动分页时的每页大约字符数,必须大于0</li>"
	end if
'=====================================================================
	if Receive="yes" and SysTemVersion > 0 then
		if ReceiveUser="" then
			FoundErr=True
			ErrMsg=ErrMsg & "<br /><li>请指定要签收的用户。</li>"
		else
			if Not Isnumeric(AutoReceiveTime) then AutoReceiveTime=0
			if Not Isnumeric(ReceiveType) then ReceiveType=0
			AutoReceiveTime=Clng(AutoReceiveTime)
			ReceiveType=Cint(ReceiveType)
			if ReceiveType<>0 And ReceiveType<>1 then ReceiveType=0
			if Left(ReceiveUser,1)<>"|" then ReceiveUser="|"&ReceiveUser
			if Right(ReceiveUser,1)<>"|" then ReceiveUser=ReceiveUser&"|"
		end if
	end if
 '=====================================================================
	if FoundErr=True then Cl.ShowErr(ErrMsg)
	dim sTempP
	IsTruePurview	= False
	IsTruePurview_P	= False
	if Cl.TrueChannelPurview_U(2,ChannelID) then
		IsTruePurview	= True
		IsTruePurview_P	= True
	else
		sTempP=Split(ParentPath & "," & ClassID,",")
		for i=1 to Ubound(sTempP)
			IsTruePurview = Cl.TrueClassPurview_U(3,ChannelID,sTempP(i))
			if IsTruePurview Then Exit For
		Next
		for i=1 to Ubound(sTempP)
			IsTruePurview_P = Cl.TrueClassPurview_U(2,ChannelID,sTempP(i))
			if IsTruePurview_P Then Exit For
		Next
	end if
	if Not IsTruePurview then 
		Cl.ShowErr("<br /><li>您无权在此栏目下添加或修改资料。</li>")
	end if
	if SpecialID="" Or SpecialID="0" then
		SpecialID="0"
	else
		SpecialID=Replace(SpecialID," ","")
		if Len(SpecialID)>250 then
			Dim TempStr,SpecialStr
			TempStr=Split(SpecialID,",")
			For i=0 to Ubound(TempStr)
				if TempStr(i)<>"" then SpecialStr=SpecialStr & "," & TempStr(i)
				if Len(SpecialStr)>=230 then Exit For
			Next
			SpecialID=SpecialStr & ","
		else
		SpecialID=","&SpecialID&","
		End If
		SpecialID=Replace(SpecialID,",0,",",")
	end if
	Keyword=Cl.ReplaceBadChar(Keyword)
	Keyword=Replace(Keyword,"||","|")
	if Left(Keyword,1)="|" then Keyword=Right(Keyword,Len(Keyword)-1)
	if Right(Keyword,1)="|" then Keyword=Left(Keyword,Len(Keyword)-1)
	'Title=Cl.HTMLEncode(Title)
	if AuthorName="" then
		Author="佚名"
	else
		Author=AuthorName
		if AuthorEmail<>"" then Author=Author & "|" & AuthorEmail
	end if
	if CopyFromName="" then
		CopyFrom="创力|www.aspoo.cn"
	else
		CopyFrom=CopyFromName
		if CopyFromUrl<>"" then CopyFrom=CopyFrom & "|" & CopyFromUrl
	end if			
	if UpdateTime<>"" and IsDate(UpdateTime) then
		UpdateTime = CDate(UpdateTime)
	else
		UpdateTime = now()
	end if
	InfoGroup=Replace(InfoGroup," ","")
	if Not IsNumeric(Replace(InfoGroup,",","")) then InfoGroup="5"
	if OnTop="yes" then OnTop=True Else OnTop=False end if
	if Hot="yes" then Hot=True Else Hot=False end if
	if Elite="yes" then Elite=True Else Elite=False end If
	if Passed="yes" then Passed=True else Passed=False end If
	
	Title		= Server.HtmlEnCode(Title)
	Keyword		= Server.HtmlEnCode(Keyword)
	If TitleIntact<>""	Then TitleIntact	= Server.HtmlEnCode(TitleIntact)
	If Author<>""		Then Author			= Server.HtmlEnCode(Author)
	If CopyFrom<>""		Then CopyFrom		= Server.HtmlEnCode(CopyFrom)
	If PicUrl<>""		Then PicUrl			= Server.HtmlEnCode(PicUrl)
	If Intro<>""		Then Intro			= Server.HtmlEnCode(Intro)

	set rs=server.createobject("adodb.recordset")
	if Action="SaveAdd" then
		Dim MaxAID
		MaxAID=Cl.Execute("select max(InfoID) from Cl_Article")(0)
		if isnull(MaxAID) or Not IsNumeric(MaxAID) then MaxAID=0
		InfoID=MaxAID+1
		sql="select Top 1 * From Cl_Article"
		OpenConn : rs.open sql,Conn,1,3
		rs.addnew
		rs("InfoID")=InfoID
		rs("ChannelID")=ChannelID
		call SaveData()
		rs("Editor")=Editor
		rs.update
	ElseIf Action="SaveModify" then
		if InfoID<=0 then Cl.ShowErr("<br /><li>不能确定InfoID的值</li>")
		sql="select * From Cl_Article where InfoID=" & InfoID
		OpenConn : rs.open sql,Conn,1,3
		if rs.bof and rs.eof then
			rs.close : set rs=Nothing
			Cl.ShowErr("<br /><li>找不到此文章,可能已经被其他人删除。</li>")
		else
			Editor	= rs("Editor")
			if rs("Status")=1 then
				Cl.Execute_U("update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "-"&sAddPoint&"," & Db.DataCount & "=" & Db.DataCount & "-1 where " & Db.UserName & "='" & Editor & "'")
			end if
			if rs("Receive")=True and SysTemVersion > 0 then
				DelReceiveUser rs("ReceiveUser"),InfoID
			end if
			call SaveData()
			rs.update
		end if
	else
		Cl.ShowErr("<br /><li>参数错误!</li>")
	end if
	rs.close : set rs=Nothing
'=====================================================================
	if Receive="yes" and SysTemVersion > 0 then
		UpReceiveUser ReceiveUser,InfoID
	end if
	Cl.ChkUploadFile InfoID,PicUrl & Content,UploadFiles
	Cl.SaveAdminLog
Rem 用Cookies保存用户最后录入的资料信息
	Response.Cookies("Article")("ClassID")		= ClassID
	Response.Cookies("Article")("SpecialID")	= SpecialID
	Response.Cookies("Article")("Prefixion")	= Prefixion
	Response.Cookies("Article")("FontColor")	= FontColor
	Response.Cookies("Article")("FontType")		= FontType
	Response.Cookies("Article")("Keyword")		= Keyword
	Response.Cookies("Article")("InfoGroup")	= InfoGroup
	Response.Cookies("Article")("InfoPoint")	= InfoPoint
	Response.Cookies("Article")("InfoMoney")	= InfoMoney
	Response.Cookies("Article")("BackPoint")	= BackPoint
	Response.Cookies("Article")("BackPointRate")= BackPointRate
	Response.Cookies("Article")("BackMoney")	= BackMoney
	Response.Cookies("Article")("BackMoneyRate")= BackMoneyRate

	Response.Cookies("Article")("Author")		= Author
	Response.Cookies("Article")("CopyFro

⌨️ 快捷键说明

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