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

📄 admin_soft.asp

📁 正版创力4.1SQL商业版!!!ASP版。
💻 ASP
📖 第 1 页 / 共 5 页
字号:

Sub DoSaveRecord()
	FoundErr		= False
	InfoID			= Cl.GetClng(Request.Form("InfoID"))
	ClassID			= Cl.GetClng(request.form("ClassID"))
	SpecialID		= Trim(request.Form("SpecialID"))
	SoftName		= Trim(request.form("SoftName"))
	FontColor		= Trim(request.form("FontColor"))
	FontType		= Cl.GetClng(request.form("FontType"))
	SoftVersion		= Trim(request.form("SoftVersion"))
	SoftType		= Trim(request.form("SoftType"))
	SoftLanguage	= Trim(request.form("SoftLanguage"))
	CopyrightType	= Trim(request.form("CopyrightType"))
	OperatingSystem	= Trim(request.form("OperatingSystem"))
	Author			= Trim(request.form("Author"))
	AuthorEmail		= Trim(request.form("AuthorEmail"))
	AuthorHomepage	= Trim(request.form("AuthorHomePage"))
	DemoUrl			= Trim(request.form("DemoUrl"))
	RegUrl			= Trim(request.form("RegUrl"))
	PicUrl			= Trim(request.form("PicUrl"))
	Intro			= Trim(request.form("Intro"))
	Keyword			= Trim(request.form("Keyword"))
	OnTop			= Trim(request.form("OnTop"))
	Hot				= Trim(request.form("Hot"))
	Elite			= Trim(request.form("Elite"))
	Stars			= Cl.GetClng(request.form("Stars"))
	UpdateTime		= Trim(request.form("UpdateTime"))
	Hits			= Cl.GetClng(request.form("Hits"))
	DayHits			= Cl.GetClng(request.form("DayHits"))
	WeekHits		= Cl.GetClng(request.form("WeekHits"))
	MonthHits		= Cl.GetClng(request.form("MonthHits"))
	InfoGroup		= Trim(request.form("InfoGroup"))
	InfoPoint		= Cl.GetClng(request.form("InfoPoint"))
	InfoMoney		= Cl.GetClng(request.form("InfoMoney"))
	BackPoint		= Cl.GetClng(request.form("BackPoint"))
	BackPointRate	= Cl.GetClng(request.form("BackPointRate"))
	BackMoney		= Cl.GetClng(request.form("BackMoney"))
	BackMoneyRate	= Cl.GetClng(request.form("BackMoneyRate"))
	Passed			= Trim(request.form("Passed"))
	SoftPassword	= Trim(request.form("SoftPassword"))
	SoftSize		= Cl.GetClng(request.form("SoftSize"))
	SizeUnit		= Trim(request.form("SizeUnit"))
	DownloadUrls	= Trim(request.form("DownloadUrls"))
	NowCreate		= Trim(request.form("NowCreate"))
	UploadFiles		= Trim(request.form("UploadFiles"))
	UseServer		= Trim(request.form("UseServer"))
	FileAddress		= Trim(request.form("FileAddress"))
	ProjectID		= Cl.GetClng(request.form("ProjectID"))
	TemplateID		= Cl.GetClng(request.form("TemplateID"))
	CssID			= Cl.GetClng(request.form("CssID"))
	Editor			= Cl.MemberName
	if ClassID<=0 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>指定了非法的栏目(外部栏目或不存在的栏目)</li>"
	end if
	if SoftName="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>软件名称不能为空</li>"
	end if
	if SoftType="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>软件类别不能为空</li>"
	end if
	if Softlanguage="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>软件语言不能为空</li>"
	end if
	if CopyrightType="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>授权形式不能为空</li>"
	end if
	if Author="" then
		founderr=true
		errmsg=errmsg & "<br /><li>请输入软件作者/开发商</li>"
	end if
	if Keyword="" then
		founderr=true
		errmsg=errmsg & "<br /><li>请输入软件关键字</li>"
	end if
	if Lcase(UseServer)="yes" then
		UseServer=True
		if FileAddress="" then
			founderr=true
			errmsg=errmsg & "<br /><li>下载文件地址不能为空</li>"
		end if
	else
		UseServer=False
		if DownloadUrls="" 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
		if sAddIsChk=False then
			Passed=True
		elseif Passed = "yes" then
			if ParentID>0 then
				dim sqlPath,rsPath
				sqlPath="select ClassMaster From Cl_Class where ChannelID="&ChannelID&" and ClassID in (" & ParentPath & ") order by Depth"
				set rsPath=Cl.Execute(sqlPath)
				if Not rsPath.eof then
					sqlPath=rsPath.GetRows(-1)
					for i=0 to Ubound(sqlPath,2)
						ClassMaster = ClassMaster & "|" & sqlPath(0,i)
					Next
					sqlPath=Empty
				End if
				rsPath.Close:Set rsPath=Nothing
			end if
			IsClassMaster=Cl.TrueClassMaster(ClassMaster,Cl.Admin_Info(1))
			if IsClassMaster then
				Passed = True
			elseif Cl.TrueChannelPurview(2,ChannelID) then
				Passed = True
			else
				Passed = Cl.TrueArrClassPurview(2,ChannelID,ParentPath & "," & ClassID)
			end if
		else
			Passed=False
		end if
	end if
	tClass.Close :Set tClass=Nothing
	if Intro="" then
		Intro="暂无简介"
	else
		if Cl.strLength(Intro)>sMaxLimit and sMaxLimit<>0 then
			founderr=True
			errmsg=errmsg & "<br /><li>简介内容大小超过了最大限制("&sMaxLimit&" 字节!)</li>"
		end if
		if Trim(Cl.Web_Setting(9))="Yes" then
			Intro=Cl.DeCode(Intro,Trim(Cl.Web_Setting(10)))
		end if
	end If
	if FoundErr=True then Cl.ShowErr(ErrMsg)
	if SpecialID="" 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)
	if UpdateTime<>"" and IsDate(UpdateTime)=true then
		UpdateTime=CDate(UpdateTime)
	else
		UpdateTime=now()
	end if
	InfoGroup=Replace(InfoGroup," ","")
	if Not IsNumeric(Replace(InfoGroup,",","")) then InfoGroup="5"
	SoftSize=Cl.CheckUnit(SoftSize,SizeUnit)
	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
	
	SoftName		= Server.HtmlEnCode(SoftName)
	Keyword			= Server.HtmlEnCode(Keyword)
	If FontColor<>""		Then FontColor		= Server.HtmlEnCode(FontColor)
	If SoftVersion<>""		Then SoftVersion	= Server.HtmlEnCode(SoftVersion)
	If Author<>""			Then Author			= Server.HtmlEnCode(Author)
	If AuthorEmail<>""		Then AuthorEmail	= Server.HtmlEnCode(AuthorEmail)
	If AuthorHomepage<>""	Then AuthorHomepage	= Server.HtmlEnCode(AuthorHomepage)
	If DemoUrl<>""			Then DemoUrl		= Server.HtmlEnCode(DemoUrl)
	If RegUrl<>""			Then RegUrl			= Server.HtmlEnCode(RegUrl)
	If PicUrl<>""			Then PicUrl			= Server.HtmlEnCode(PicUrl)
	If SoftPassword<>""		Then SoftPassword	= Server.HtmlEnCode(SoftPassword)
	If OperatingSystem<>""	Then OperatingSystem= Server.HtmlEnCode(OperatingSystem)
	If SoftType<>""			Then SoftType		= Server.HtmlEnCode(SoftType)
	If SoftLanguage<>""		Then SoftLanguage	= Server.HtmlEnCode(SoftLanguage)
	If CopyrightType<>""	Then CopyrightType	= Server.HtmlEnCode(CopyrightType)

	set rs=server.createobject("adodb.recordset")
	if Action="SaveAdd" then
		Dim MaxTID
		MaxTID=Cl.Execute("select max(InfoID) from Cl_Soft")(0)
		if isnull(MaxTID) or Not IsNumeric(MaxTID) then MaxTID=0
		InfoID=MaxTID+1
		sql="select Top 1 * from Cl_Soft" 
		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>")
		else
			sql="select * from Cl_Soft 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
				call SaveData()
				rs.update
			end if
		end if
	else
		Cl.ShowErr("<br /><li>参数错误!</li>")
	end if
	rs.close : set rs=Nothing
	Cl.ChkUploadFile InfoID,PicUrl & FileAddress & DownloadUrls & Intro,UploadFiles
	Cl.SaveAdminLog
Rem 用Cookies保存用户最后录入的资料信息
	Response.Cookies("Soft")("ClassID")		= ClassID
	Response.Cookies("Soft")("SpecialID")	= SpecialID
	Response.Cookies("Soft")("Prefixion")	= Prefixion
	Response.Cookies("Soft")("FontColor")	= FontColor
	Response.Cookies("Soft")("FontType")	= FontType
	Response.Cookies("Soft")("Keyword")		= Keyword
	Response.Cookies("Soft")("InfoGroup")	= InfoGroup
	Response.Cookies("Soft")("InfoPoint")	= InfoPoint
	Response.Cookies("Soft")("InfoMoney")	= InfoMoney
	Response.Cookies("Soft")("BackPoint")	= BackPoint
	Response.Cookies("Soft")("BackPointRate")= BackPointRate
	Response.Cookies("Soft")("BackMoney")	= BackMoney
	Response.Cookies("Soft")("BackMoneyRate")= BackMoneyRate
	Response.Cookies("Soft")("Author")		= Author
	Response.Cookies("Soft")("AuthorEmail")	= AuthorEmail
	Response.Cookies("Soft")("AuthorHomepage")= AuthorHomepage
	Response.Cookies("Soft")("DemoUrl")		= DemoUrl
	Response.Cookies("Soft")("RegUrl")		= RegUrl
	Response.Cookies("Soft")("OperatingSystem")= OperatingSystem
	Response.Cookies("Soft")("SoftType")	= SoftType
	Response.Cookies("Soft")("SoftLanguage")= SoftLanguage
	Response.Cookies("Soft")("CopyrightType")= CopyrightType
	Response.Cookies("Soft")("UseServer")	= UseServer
Rem End
	SaveSuccess
end sub

sub SaveData()
	rs("ChannelDir")	= Cl.Channel.selectSingleNode("@channeldir").text
	rs("ClassID")		= ClassID
	rs("SpecialID")		= SpecialID
	rs("Prefixion")		= Prefixion
	rs("SoftName")		= SoftName
	rs("FontColor")		= FontColor
	rs("FontType")		= FontType
	r

⌨️ 快捷键说明

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