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

📄 admin_style.asp

📁 唐网公司企业网站管理系统源码 双数据库 sql access 功能强大 易于扩展
💻 ASP
📖 第 1 页 / 共 3 页
字号:
	sStyleHeight = Trim(Request("d_height"))
	sStyleMemo = Request("d_memo")
	sStyleImageExt = Request("d_imageext")
	sStyleFlashExt = Request("d_flashext")
	sStyleMediaExt = Request("d_mediaext")
	sStyleRemoteExt = Request("d_remoteext")
	sStyleFileExt = Request("d_fileext")
	sStyleImageSize = Request("d_imagesize")
	sStyleFlashSize = Request("d_flashsize")
	sStyleMediaSize = Request("d_mediasize")
	sStyleRemoteSize = Request("d_remotesize")
	sStyleFileSize = Request("d_filesize")
	sStyleStateFlag = Request("d_stateflag")
	sStyleAutoRemote = Request("d_autoremote")
	sStyleShowBorder = Request("d_showborder")
	sStyleUploadObject = Request("d_uploadobject")
	sStyleAutoDir = Request("d_autodir")
	sStyleDetectFromWord = Request("d_detectfromword")
	sStyleInitMode = Request("d_initmode")
	sStyleBaseUrl = Request("d_baseurl")

	sStyleUploadDir = Replace(sStyleUploadDir, "\", "/")
	sStyleBaseHref = Replace(sStyleBaseHref, "\", "/")
	sStyleContentPath = Replace(sStyleContentPath, "\", "/")
	If Right(sStyleUploadDir, 1) <> "/" Then sStyleUploadDir = sStyleUploadDir & "/"
	If Right(sStyleBaseHref, 1) <> "/" Then sStyleBaseHref = sStyleBaseHref & "/"
	If Right(sStyleContentPath, 1) <> "/" Then sStyleContentPath = sStyleContentPath & "/"

	If sStyleName = "" Or Get_TrueLen(sStyleName) > 50 Then
		Go_Error "样式名不能为空,且不大于50个字符长度!"
	End If
	If IsSafeStr(sStyleName) = False Then
		Go_Error "样式名请勿包含特殊字符!"
	End If
	If sStyleDir = "" Or Get_TrueLen(sStyleDir) > 50 Then
		Go_Error "按钮图片目录名不能为空,且不大于50个字符长度!"
	End If
	If IsSafeStr(sStyleDir) = False Then
		Go_Error "按钮图片目录名请勿包含特殊字符!"
	End If
	If sStyleCSS = "" Or Get_TrueLen(sStyleCSS) > 50 Then
		Go_Error "样式CSS目录名不能为空,且不大于50个字符长度!"
	End If
	If IsSafeStr(sStyleCSS) = False Then
		Go_Error "样式CSS目录名请勿包含特殊字符!"
	End If

	If sStyleUploadDir = "" Or Get_TrueLen(sStyleUploadDir) > 50 Then
		Go_Error "上传路径不能为空,且不大于50个字符长度!"
	End If
	If IsSafeStr(sStyleUploadDir) = False Then
		Go_Error "上传路径请勿包含特殊字符!"
	End If
	Select Case sStyleBaseUrl
	Case "0"
		If sStyleBaseHref = "" Or Get_TrueLen(sStyleBaseHref) > 50 Then
			Go_Error "当使用相对路径模式时,显示路径不能为空,且不大于50个字符长度!"
		End If
		If IsSafeStr(sStyleBaseHref) = False Then
			Go_Error "当使用相对路径模式时,显示路径请勿包含特殊字符!"
		End If
		If Left(sStyleBaseHref, 1) <> "/" Then
			Go_Error "当使用相对路径模式时,显示路径必须以&quot;/&quot;开头!"
		End If

		If sStyleContentPath = "" Or Get_TrueLen(sStyleContentPath) > 50 Then
			Go_Error "当使用相对路径模式时,内容路径不能为空,且不大于50个字符长度!"
		End If
		If IsSafeStr(sStyleContentPath) = False Then
			Go_Error "当使用相对路径模式时,内容路径请勿包含特殊字符!"
		End If
		If Left(sStyleContentPath, 1) = "/" Then
			Go_Error "当使用相对路径模式时,内容路径不能以&quot;/&quot;开头!"
		End If
	Case "1", "2"
		sStyleBaseHref = ""
		sStyleContentPath = ""
	End Select
	
	If IsNumeric(sStyleWidth) = False Then
		Go_Error "请填写有效的最佳引用宽度!"
	End If
	If IsNumeric(sStyleHeight) = False Then
		Go_Error "请填写有效的最佳引用高度!"
	End If

	If Get_TrueLen(sStyleImageExt) > 250 Then
		Go_Error "图片文件类型不能大于250个字符长度!"
	End If
	If Get_TrueLen(sStyleFlashExt) > 250 Then
		Go_Error "Flash文件类型不能大于250个字符长度!"
	End If
	If Get_TrueLen(sStyleMediaExt) > 250 Then
		Go_Error "媒体文件类型不能大于250个字符长度!"
	End If
	If Get_TrueLen(sStyleFileExt) > 250 Then
		Go_Error "其它文件类型不能大于250个字符长度!"
	End If
	If Get_TrueLen(sStyleRemoteExt) > 250 Then
		Go_Error "远程文件类型不能大于250个字符长度!"
	End If

	If IsNumeric(sStyleImageSize) = False Then
		Go_Error "请填写有效的图片限制大小!"
	End If
	If IsNumeric(sStyleFlashSize) = False Then
		Go_Error "请填写有效的Flash限制大小!"
	End If
	If IsNumeric(sStyleMediaSize) = False Then
		Go_Error "请填写有效的媒体文件限制大小!"
	End If
	If IsNumeric(sStyleFileSize) = False Then
		Go_Error "请填写有效的其它文件限制大小!"
	End If
	If IsNumeric(sStyleRemoteSize) = False Then
		Go_Error "请填写有效的远程文件限制大小!"
	End If

End Sub

' 样式新增保存
Sub DoStyleAddSave()
	sSql = "select * from ewebeditor_style where s_name='" & sStyleName & "'"
	oRs.Open sSql, oConn, 0, 1
	If Not oRs.Eof Then
		Go_Error "此样式名已经存在,请用另一个样式名!"
	End If
	oRs.Close

	sSql = "select * from ewebeditor_style where s_id=0"
	oRs.Open sSql, oConn, 1, 3
	oRs.AddNew
	oRs("S_Name") = sStyleName
	oRs("S_Dir") = sStyleDir
	oRs("S_CSS") = sStyleCSS
	oRs("S_UploadDir") = sStyleUploadDir
	oRs("S_BaseHref") = sStyleBaseHref
	oRs("S_ContentPath") = sStyleContentPath
	oRs("S_Width") = sStyleWidth
	oRs("S_Height") = sStyleHeight
	oRs("S_Memo") = sStyleMemo
	oRs("S_ImageExt") = sStyleImageExt
	oRs("S_FlashExt") = sStyleFlashExt
	oRs("S_MediaExt") = sStyleMediaExt
	oRs("S_FileExt") = sStyleFileExt
	oRs("S_RemoteExt") = sStyleRemoteExt
	oRs("S_ImageSize") = sStyleImageSize
	oRs("S_FlashSize") = sStyleFlashSize
	oRs("S_MediaSize") = sStyleMediaSize
	oRs("S_FileSize") = sStyleFileSize
	oRs("S_RemoteSize") = sStyleRemoteSize
	oRs("S_StateFlag") = sStyleStateFlag
	oRs("S_AutoRemote") = sStyleAutoRemote
	oRs("S_ShowBorder") = sStyleShowBorder
	oRs("S_UploadObject") = sStyleUploadObject
	oRs("S_AutoDir") = sStyleAutoDir
	oRs("S_DetectFromWord") = sStyleDetectFromWord
	oRs("S_InitMode") = sStyleInitMode
	oRs("S_BaseUrl") = sStyleBaseUrl
	oRs.Update
	sStyleID = oRs("S_ID")
	oRs.Close

	Response.Write "<br><table border=0 cellspacing=20 align=center>" & _
		"<tr valign=top><td><img src='admin/do_ok.gif' border=0></td><td><b><span class=highlight2>样式增加成功!</span></b><br><br><ul>我现在<br><br><li><a href='admin_default.asp'>返回后台管理首页</a><li><a href='?'>返回样式管理</a><li><a href='?action=toolbar&id=" & sStyleID & "'>设置此样式下的工具栏</a></ul></td></tr>" & _
		"</table><br><br>"

End Sub


' 样式修改保存
Sub DoStyleSetSave()
	sStyleID = Trim(Request("id"))
	If IsNumeric(sStyleID) = True Then
		' 是否存在同名
		sSql = "select * from ewebeditor_style where s_name='" & sStyleName & "' and s_id<>" & sStyleID
		oRs.Open sSql, oConn, 0, 1
		If Not oRs.Eof Then
			Go_Error "此样式名已经存在,请用另一个样式名!"
		End If
		oRs.Close
		
		sSql = "select * from ewebeditor_style where s_id=" & sStyleID
		oRs.Open sSql, oConn, 1, 3
		If Not oRs.Eof Then
			If oRs("S_IsSys") = 1 Then
				Go_Error "系统样式,不允许修改!"
			End If
		Else
			Go_Error "无效的样式ID号,请通过页面上的链接进行操作!"
		End If
		oRs("S_Name") = sStyleName
		oRs("S_Dir") = sStyleDir
		oRs("S_CSS") = sStyleCSS
		oRs("S_UploadDir") = sStyleUploadDir
		oRs("S_BaseHref") = sStyleBaseHref
		oRs("S_ContentPath") = sStyleContentPath
		oRs("S_Width") = sStyleWidth
		oRs("S_Height") = sStyleHeight
		oRs("S_Memo") = sStyleMemo
		oRs("S_ImageExt") = sStyleImageExt
		oRs("S_FlashExt") = sStyleFlashExt
		oRs("S_MediaExt") = sStyleMediaExt
		oRs("S_FileExt") = sStyleFileExt
		oRs("S_RemoteExt") = sStyleRemoteExt
		oRs("S_ImageSize") = sStyleImageSize
		oRs("S_FlashSize") = sStyleFlashSize
		oRs("S_MediaSize") = sStyleMediaSize
		oRs("S_RemoteSize") = sStyleRemoteSize
		oRs("S_FileSize") = sStyleFileSize
		oRs("S_StateFlag") = sStyleStateFlag
		oRs("S_AutoRemote") = sStyleAutoRemote
		oRs("S_ShowBorder") = sStyleShowBorder
		oRs("S_UploadObject") = sStyleUploadObject
		oRs("S_AutoDir") = sStyleAutoDir
		oRs("S_DetectFromWord") = sStyleDetectFromWord
		oRs("S_InitMode") = sStyleInitMode
		oRs("S_BaseUrl") = sStyleBaseUrl
		oRs.Update
		oRs.Close
	Else
		Go_Error "无效的样式ID号,请通过页面上的链接进行操作!"
	End If

	Response.Write "<br><table border=0 cellspacing=20 align=center>" & _
		"<tr valign=top><td><img src='admin/do_ok.gif' border=0></td><td><b><span class=highlight2>样式修改成功!</span></b><br><br><ul>我现在<br><br><li><a href='admin_default.asp'>返回后台管理首页</a><li><a href='?'>返回样式管理</a><li><a href='?action=toolbar&id=" & sStyleID & "'>设置此样式下的工具栏</a></ul></td></tr>" & _
		"</table><br><br>"

End Sub

' 样式删除
Sub DoStyleDel()
	If nStyleIsSys = 0 Then
		sSql = "delete from ewebeditor_style where s_id=" & sStyleID
		oConn.Execute sSql
		sSql = "delete from ewebeditor_toolbar where s_id=" & sStyleID
		oConn.Execute sSql
	End If
End Sub

' 样式预览
Sub ShowStylePreview()
	Response.Write "<html><head>" & _
		"<title>样式预览</title>" & _
		"<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & _
		"</head><body>" & _
		"<input type=hidden name=content1  value=''>" & _
		"<iframe ID='eWebEditor1' src='ewebeditor.asp?id=content1&style=" & sStyleName & "' frameborder=0 scrolling=no width='" & sStyleWidth & "' HEIGHT='" & sStyleHeight & "'></iframe>" & _
		"</body></html>"
End Sub

' 显示引用代码
Sub ShowStyleCode()
	Response.Write "<table border=0 cellpadding=5 cellspacing=0 height=20 width='100%'><tr><td align=right><a href='javascript:history.back()'>返回</a></td></tr></table>"
	Response.Write "<table width='90%' border=0 align='center' cellpadding=5 cellspacing=0 height=20 width='100%'><tr><td><p class=highlight2>样式(<b>" & outHTML(sStyleName) & "</b>)的最佳调用代码如下(其中XXX按实际关联的表单项进行修改):</p>"
	Response.Write "<textarea rows=5 cols=65 style='width:100%'><IFRAME ID=""eWebEditor1"" SRC=""ewebeditor.asp?id=XXX&style=" & sStyleName & """ FRAMEBORDER=""0"" SCROLLING=""no"" WIDTH=""" & sStyleWidth & """ HEIGHT=""" & sStyleHeight & """></IFRAME></textarea><br><br></td></tr></table>"
End Sub

' 显示工具栏表单列表
Sub ShowToolBarList()
	Response.Write "<table border=0 cellpadding=5 cellspacing=0 height=20 width='100%'><tr>" & _
		"<td class=highlight2><b>样式(" & outHTML(sStyleName) & ")下的工具栏管理:</b></td>" & _
		"<td align=right><a href='?'>返回样式管理</a></td></tr></table>"

	Dim s_AddForm, s_ModiForm

	' 增加表单
	If nStyleIsSys = 1 Then
		s_AddForm = ""
	Else
		' 取当前最大排序号
		Dim nMaxOrder
		sSql = "select max(T_order) from ewebeditor_toolbar where s_id=" & sStyleID
		oRs.Open sSql, oConn, 0, 1
		If IsNull(oRs(0)) Then
			nMaxOrder = 1
		Else
			nMaxOrder = oRs(0) + 1
		End If
		oRs.Close

		s_AddForm = "<hr width='95%' align=center size=1><table border=0 cellpadding=4 cellspacing=0 align=center>" & _
		"<form action='?id=" & sStyleID & "&action=toolbaradd' name='addform' method=post>" & _
		"<tr><td>工具栏名:<input type=text name=d_name size=20 class=input value='工具栏" & nMaxOrder & "'> 排序号:<input type=text name=d_order size=5 value='" & nMaxOrder & "' class=input> <input type=submit name=b1 value='新增工具栏'></td></tr>" & _
		"</form></table><hr width='95%' align=center size=1>"
	End If

	' 修改表单
	Dim s_Manage, s_SubmitButton
	s_ModiForm = "<form action='?id=" & sStyleID & "&action=toolbarmodi' name=modiform method=post>" & _
		"<table border=0 cellpadding=0 cellspacing=0 align=center class=list1>" & _
		"<tr align=center><th>ID</th><th>工具栏名</th><th>排序号</th><th>操作</th></tr>"
	sSql = "select * from ewebeditor_toolbar where s_id=" & sStyleID & " order by t_order asc"
	oRs.Open sSql, oConn, 0, 1
	Do While Not oRs.Eof
		s_Manage = "<a href='?id=" & sStyleID & "&action=buttonset&toolbarid=" & oRs("t_id") & "'>按钮设置</a>"
		If nStyleIsSys <> 1 Then
			s_Manage = s_Manage & "|<a href='?id=" & sStyleID & "&action=toolbardel&delid=" & oRs("t_id") & "'>删除</a>"
		End If
		s_ModiForm = s_ModiForm & "<tr align=center>" & _
			"<td>" & oRs("t_id") & "</td>" & _
			"<td><input type=text name='d_name" & oRs("t_id") & "' value=""" & inHTML(oRs("t_name")) & """ size=30 class=input></td>" & _
			"<td><input type=text name='d_order" & oRs("t_id") & "' value='" & oRs("t_order") & "' size=5 class=input></td>" & _
			"<td>" & s_Manage & "</td>" & _
			"</tr>"
		oRs.MoveNext
	Loop
	oRs.Close
	If nStyleIsSys = 1 Then
		s_SubmitButton = ""
	Else
		s_SubmitButton = "<p align=center><input type=submit name=b1 value=' 修改 '></p>"
	End If
	s_ModiForm = s_ModiForm & "</table>" & s_SubmitButton & "</form><br><br>"

	' 输出表单
	Response.Write s_AddForm & s_ModiForm

End Sub

' 新增工具栏

⌨️ 快捷键说明

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