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

📄 savesys.asp

📁 有很多功能的留言版,很容易上手,有自动添加图片、表情。管理员功能也强大
💻 ASP
📖 第 1 页 / 共 2 页
字号:
			 Next
			 FileName = Right(FileName,(len(FileName)-InStrRev(FileName,".")+1))
			Select Case TextType
				Case 0
					FilePath = "textchange/Number/"
					MakeName = Replace(MakeName,"1","a")
					MakeName = Replace(MakeName,"2","b")
					MakeName = Replace(MakeName,"3","c")
					MakeName = Replace(MakeName,"4","d")
					MakeName = Replace(MakeName,"5","e")
					MakeName = Replace(MakeName,"6","f")
					MakeName = Replace(MakeName,"7","i")
					MakeName = Replace(MakeName,"8","j")
					MakeName = Replace(MakeName,"9","k")
					MakeName = Replace(MakeName,"0","l")
					FileName = MakeName & FileName
				Case 1
					FileName = MakeName & FileName
					FilePath = "textchange/English/"
				Case 2
					FilePath = "textchange/Chinese/"
					FileName = MakeName & FileName
				Case 3
					FilePath = "textchange/Point/"
					FileName = MakeName & FileName
			End Select
		End Sub
		
		Public Function CheckSys_ChangeInfo(TextName,file,FileName,FilePath)
			If TextName = Empty Then CallErr("<Li>请输入需要转换的文字类型")
			If Len(TextName) > 15 Then CallErr("<Li>你输入的转换内容超出了系统限制的字数!")
			If file.fileSize>50000 or file.fileSize=0 then CallErr("<Li>你上传的是空图片或图片大小超出系统限制的50K")
			If Lcase(right(FileName,4))<>".gif" and Lcase(right(FileName,4))<>".jpg" and  Lcase(right(FileName,4))<>".bmp" then CallErr("<li>你上传的图片格式不对,系统只支持上传JPG,GIF,BMP类型的图片")
			If Not Conn.Execute("Select Id From [TextChange] Where TextName = '"&TextName&"'").Eof Then CallErr("<Li>已存在该字符转换!")
			TextPicPath = "<img src="&FilePath&FileName&">"
			If Not Conn.Execute("Select Id From [TextChange] Where ChangePath = '"&TextPicPath&"'").Eof Then CallErr("<Li>图片路径已存在,请再次上传重新取得图片路径!")
		End Function
		
		Public Function UpdateSys_Change(TextName,file,FileName,FilePath)
			File.SaveAs Server.mappath(FilePath&FileName)
			set File=nothing
			ChangePath = "<img src="&FilePath&FileName&">"
			Conn.Execute("Insert Into [TextChange] (TextName,ChangePath,Us) Values ('"&TextName&"','"&ChangePath&"',1)")
		End Function
		
		Public Sub GetSys_ChangeEditInfo(sId)
			Id = sId
			If sId=empty Or isnumeric(sId)=0 Then CallErr("<Li>修改参数错误!")
			SqlStr = "Select TextName,ChangePath From [TextChange] Where Id="&Id
			Set Rs = Conn.Execute(SqlStr)
			If Rs.Eof Then CallErr("<Li>不存在该字符定义!")
				ArriRs = Rs.GetRows
			Rs.Close
			Set Rs = Nothing
		End Sub
		
		Public Sub CheckSys_ChangeTextEdit(TextName,file,sTextName,sfilepath)
			If TextName <> sTextName Then TxtEdit = 1
			If file.fileSize > 0 Then
				FilePath = Lcase(sfilepath)
				FilePath = Left(FilePath,21)
				FilePath = Right(FilePath,1)
				Select Case FilePath
					Case "n"
						TextType = 0 
					Case "e"
						TextType = 1 						
					Case "c"
						TextType = 2 						
					Case "p"
						TextType = 3 
				End Select
				ImgEdit = 1
			End If
		End Sub
		
		Public Function Check_ChangeTextEdit(TxtEdit,ImgEdit,TextName,file,FileName,FilePath,Id)
			If TextName = Empty Then CallErr("<Li>请输入需要修改的转换字符")
			If Len(TextName) > 15 Then CallErr("<Li>你输入的转换内容超出了系统限制的字数!")		
			Select Case TxtEdit
				Case 1
					If Not Conn.Execute("Select Id From [TextChange] Where TextName = '"&TextName&"'").Eof Then CallErr("<Li>已存在该字符转换!")
					Conn.Execute("Update [TextChange] Set TextName = '"&TextName&"' Where Id="&Id)
			End Select
			Select Case ImgEdit
				Case 1
					TextPicPath = "<img src="&FilePath&FileName&">"
					If file.fileSize>50000 Then CallErr("<Li>你选择的图片超过系统限制的50K!")
					If Lcase(right(FileName,4))<>".gif" and Lcase(right(FileName,4))<>".jpg" and  Lcase(right(FileName,4))<>".bmp" then CallErr("<li>你上传的图片格式不对,系统只支持上传JPG,GIF,BMP类型的图片")
					If Not Conn.Execute("Select Id From [TextChange] Where ChangePath = '"&TextPicPath&"'").Eof Then CallErr("<Li>图片路径已存在,请再次上传重新取得图片路径!")
			End Select
		End Function
		
		Public Function Update_ChangeTextEdit(TxtEdit,ImgEdit,TextName,file,FileName,FilePath,Id)
			Select Case ImgEdit
				Case 1
					File.SaveAs Server.mappath(FilePath&FileName)
					set File=nothing
					ChangePath = "<img src="&FilePath&FileName&">"
					Conn.Execute("Update [TextChange] Set ChangePath = '"&ChangePath&"' Where Id="&Id)
			End Select
			If TxtEdit = 1 Then Conn.Execute("Update [TextChange] Set TextName = '"&TextName&"' Where Id="&Id)
		End Function
		
		Public Sub GetSys_Face()
			SqlStr = "Select Id,FaceName,FacePath,FaceDefault,Us From [Face] Order By Id Desc"
			Set Rs = Conn.execute(SqlStr)
			If Not Rs.eof Then
				ShowFace = 1
				ArrRs=Rs.getrows
			End If
			Rs.close
			Set Rs=Nothing
		End Sub
		
		Public Sub Check_FaceId(sId)
			Id = sId
			If Id=empty Or isnumeric(Id)=0 Then CallErr("<Li>删除参数错误!")
			If Conn.Execute("Select Id From [Face] Where Id="&Id).Eof Then CallErr("<Li>操作失败,不存在该表情!")
		End Sub
		
		Public Sub DelSys_Face (sId)
			Conn.Execute("Delete From [Face] Where Id="&sId)
		End Sub
		
		Public Sub UsSys_Face (sId)
			Us = Conn.Execute("Select Us From [Face] Where Id="&sId)(0)
			If Us = True Then Us = 0 Else Us = 1
			Conn.Execute("Update [Face] set Us = '"&Us&"' Where Id="&sId)
		End Sub
		
		Public Sub DefaultSys_Face (sId)
			FaceDefault = Conn.Execute("Select FaceDefault From [Face] Where Id="&sId)(0)
			If FaceDefault = True Then FaceDefault = 0 Else FaceDefault = 1
			Conn.Execute("Update [Face] set FaceDefault = '"&FaceDefault&"',Add_date = '"&Now()&"' Where Id="&sId)
		End Sub
		
		Public Sub GetSys_GetFaceInfo(sFaceName,sFile,stype)
			FaceName = sFaceName
			Set file = sFile
			PostType = sType		
		End Sub
		
		Public Sub GetSys_GetFaceFile(file)
			FileName = file.FileName
			 Dim i, n
			 For i = 1 to 6
				Randomize
				n = Int(Rnd()*(9-0+1)+0)
				MakeName = MakeName & n
			 Next
			 FilePath = "Face/"
			 FileName = MakeName & Right(FileName,(len(FileName)-InStrRev(FileName,".")+1))
		End Sub
		
		Public Function CheckSys_FaceInfo(FaceName,MakeName,FileName,file)
			If FaceName = Empty Then CallErr("<Li>请输入需要表情说明")
			If Len(FaceName) > 15 Then CallErr("<Li>请把表情说明限制到15字以内!")
			If file.fileSize>100000 or file.fileSize=0 then CallErr("<Li>你上传的是空图片或图片大小超出系统限制的100K")
			If Lcase(right(FileName,4))<>".gif" then CallErr("<li>你上传的图片格式不对,表情只支持上传GIF类型的图片")
			If Not Conn.Execute("Select Id From [Face] Where FacePath = '"&MakeName&"'").Eof Then CallErr("<Li>表情文件重复,请返回再次提交!")
		End Function
		
		Public Function UpdateSys_Face(FaceName,MakeName,FileName,FilePath,file)
			File.SaveAs Server.mappath(FilePath&FileName)
			set File=nothing
			Conn.Execute("Insert Into [Face] (FaceName,FacePath) Values ('"&FaceName&"','"&MakeName&"')")
		End Function
		
		Public Sub GetSys_FaceEditInfo(sId)
			Id = sId
			If sId=empty Or isnumeric(sId)=0 Then CallErr("<Li>修改参数错误!")
			SqlStr = "Select FaceName,FacePath From [Face] Where Id="&Id
			Set Rs = Conn.Execute(SqlStr)
			If Rs.Eof Then CallErr("<Li>不存在该字符定义!")
				ArriRs = Rs.GetRows
			Rs.Close
			Set Rs = Nothing
		End Sub	
		
		Public Sub CheckSys_FaceEdit(FaceName,file,sFaceName,sFilePath)
			If FaceName <> sFaceName Then TxtEdit = 1
			If file.fileSize > 0 Then
				ImgEdit = 1
				FileName = file.FileName
				FileName = sFilePath&Right(FileName,(len(FileName)-InStrRev(FileName,".")+1))
			End If
		End Sub

		Public Function Check_FaceEdit(TxtEdit,ImgEdit,FaceName,file,FileName)		
			Select Case TxtEdit
				Case 1
					If FaceName = Empty Then CallErr("<Li>请输入表情说明!")
					If Len(FaceName) > 15 Then CallErr("<Li>请把表情说明限制到15字以内!")
			End Select
			Select Case ImgEdit
				Case 1
					If file.fileSize>100000 or file.fileSize=0 then CallErr("<Li>你上传的是空图片或图片大小超出系统限制的100K")
					If Lcase(right(FileName,4))<>".gif" then CallErr("<li>你上传的图片格式不对,表情只支持上传GIF类型的图片")
			End Select
		End Function

		Public Function Update_FaceEdit(TxtEdit,ImgEdit,FaceName,file,FileName,Id)		
			Select Case TxtEdit
				Case 1
					Conn.execute("Update [Face] Set FaceName = '"&FaceName&"' Where Id="&Id)
			End Select
			Select Case ImgEdit
				Case 1
					FilePath = "Face/"
					File.SaveAs Server.mappath(FilePath&FileName)
					set File=nothing
			End Select
		End Function
		
		Public Function Update_FirstUs()
			Conn.Execute("Update [SysTem] Set BeginUs = 1")
		End Function
		
	End Class
	
</script>

⌨️ 快捷键说明

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