📄 admin_style.asp
字号:
"<tr><td align=right>备注说明:</td><td colspan=3><textarea class=textarea rows=7 cols=65 name=d_memo title='此样式的说明,更有利于调用'>" & sStyleMemo & "</textarea></td></tr>" & s_Button & _
"</form>" & _
"</table>"
Response.Write "<a name=baseurl></a><p><span class=highlight2><b>路径模式设置说明:</b></span><br>" & _
"<b>相对路径:</b>指所有的相关上传或自动插入文件路径,编辑后都以""UploadFile/...""或""../UploadFile/...""形式呈现,当使用此模式时,显示路径和内容路径必填,显示路径必须以""/""开头和结尾,内容路径设置中不能以""/""开头。<br>" & _
"<b>绝对根路径:</b>指所有的相关上传或自动插入文件路径,编辑后都以""/eWebEditor/UploadFile/...""这种形式呈现,当使用此模式时,显示路径和内容路径不必填。<br>" & _
"<b>绝对全路径:</b>指所有的相关上传或自动插入文件路径,编辑后都以""http://xxx.xxx.xxx/eWebEditor/UploadFile/...""这种形式呈现,当使用此模式时,显示路径和内容路径不必填。</p><br><br>"
End Sub
' 初始化样式表数据
Sub InitStyle()
Dim b
b = False
sStyleID = Trim(Request("id"))
If IsNumeric(sStyleID) = True Then
sSql = "select * from ewebeditor_style where s_id=" & sStyleID
oRs.Open sSql, oConn, 0, 1
If Not oRs.Eof Then
sStyleName = oRs("S_Name")
sStyleDir = oRs("S_Dir")
sStyleCSS = oRs("S_CSS")
sStyleUploadDir = oRs("S_UploadDir")
sStyleBaseHref = oRs("S_BaseHref")
sStyleContentPath = oRs("S_ContentPath")
sStyleWidth = CStr(oRs("S_Width"))
sStyleHeight = CStr(oRs("S_Height"))
sStyleMemo = oRs("S_Memo")
nStyleIsSys = oRs("S_IsSys")
sStyleFileExt = oRs("S_FileExt")
sStyleFlashExt = oRs("S_FlashExt")
sStyleImageExt = oRs("S_ImageExt")
sStyleMediaExt = oRs("S_MediaExt")
sStyleRemoteExt = oRs("S_RemoteExt")
sStyleFileSize = oRs("S_FileSize")
sStyleFlashSize = oRs("S_FlashSize")
sStyleImageSize = oRs("S_ImageSize")
sStyleMediaSize = oRs("S_MediaSize")
sStyleRemoteSize = oRs("S_RemoteSize")
sStyleStateFlag = CStr(oRs("S_StateFlag"))
sStyleAutoRemote = CStr(oRs("S_AutoRemote"))
sStyleShowBorder = CStr(oRs("S_ShowBorder"))
sStyleUploadObject = CStr(oRs("S_UploadObject"))
sStyleAutoDir = CStr(oRs("S_AutoDir"))
sStyleDetectFromWord = oRs("S_DetectFromWord")
sStyleInitMode = oRs("S_InitMode")
sStyleBaseUrl = oRs("S_BaseUrl")
b = True
End If
oRs.Close
End If
If b = False Then
Go_Error "无效的样式ID号,请通过页面上的链接进行操作!"
End If
End Sub
' 检测样式表单提交的有效性
Sub CheckStyleForm()
sStyleName = Trim(Request("d_name"))
sStyleDir = Trim(Request("d_dir"))
sStyleCSS = Trim(Request("d_css"))
sStyleUploadDir = Trim(Request("d_uploaddir"))
sStyleBaseHref = Trim(Request("d_basehref"))
sStyleContentPath = Trim(Request("d_contentpath"))
sStyleWidth = Trim(Request("d_width"))
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 "当使用相对路径模式时,显示路径必须以"/"开头!"
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 "当使用相对路径模式时,内容路径不能以"/"开头!"
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -