<% '☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆ '★ ★ '☆ eWebEditor - eWebSoft在线文本编辑器 ☆ '★ ★ '☆ 版权所有: eWebSoft.com ☆ '★ ★ '☆ 程序制作: eWeb开发团队 ☆ '★ email:webmaster@webasp.net ★ '☆ QQ:589808 ☆ '★ ★ '☆ 相关网址: [产品介绍]http://www.eWebSoft.com/Product/eWebEditor/ ☆ '★ [支持论坛]http://bbs.eWebSoft.com/ ★ '☆ ☆ '★ 主页地址: http://www.eWebSoft.com/ eWebSoft团队及产品 ★ '☆ http://www.webasp.net/ WEB技术及应用资源网站 ☆ '★ http://bbs.webasp.net/ WEB技术交流论坛 ★ '★ ★ '☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆ %> <% ' 初始输入参数 Dim sContentID, sStyleID, sFullScreen Dim sStyleName, sStyleDir, sStyleEditorHeader, sStyleBody, nStateFlag, sDetectFromWord Dim sVersion, sReleaseDate Call InitPara() ' 取所有按钮 Dim aButtonCode(), aButtonHTML() Call InitButtonArray() ' 取样式下的工具栏及按钮 Dim sToolBar Call InitToolBar() ' 断开数据库连接 Call DBConnEnd() %> eWebEditor - eWebSoft在线文本编辑器 <% If nStateFlag = 1 Then %> <% End If %>
<%=sToolBar%>
代码状态 预览状态
<% ' 显示调用错误提示 Sub ShowErr(str) Call DBConnEnd() Response.Write "调用错误:" & str Response.End End Sub ' 初始化输入参数 Sub InitPara() ' 取全屏标志 sFullScreen = Trim(Request.QueryString("fullscreen")) ' 取对应的内容ID sContentID = Trim(Request.QueryString("id")) If sContentID = "" Then ShowErr "请传入调用参数ID,即隐藏的内容表单项ID!" ' 取样式初始值 sStyleName = Trim(Request.QueryString("style")) If sStyleName = "" Then sStyleName = "standard" sSql = "select * from ewebeditor_style where s_name='" & sStyleName & "'" oRs.Open sSql, oConn, 0, 1 If Not oRs.Eof Then sStyleID = oRs("S_ID") sStyleName = oRs("S_Name") sStyleDir = oRs("S_Dir") sStyleEditorHeader = oRs("S_EditorHeader") sStyleBody = oRs("S_Body") nStateFlag = oRs("S_StateFlag") sDetectFromWord = oRs("S_DetectFromWord") Else ShowErr "无效的样式Style参数传入,如果要使用默认值,请留空!" End If oRs.Close ' 取版本号及发布日期 sSql = "select sys_version,sys_releasedate from ewebeditor_system" oRs.Open sSql, oConn, 0, 1 sVersion = oRs(0) sReleaseDate = oRs(1) oRs.Close End Sub ' 初始化按钮数组 Sub InitButtonArray() Dim i sSql = "select * from ewebeditor_button order by b_order asc" oRs.Open sSql, oConn, 0, 1 i = 0 Do While Not oRs.Eof i = i + 1 Redim Preserve aButtonCode(i) Redim Preserve aButtonHTML(i) aButtonCode(i) = oRs("B_Code") Select Case oRs("B_Type") Case 0 aButtonHTML(i) = "
" Case 1 aButtonHTML(i) = "" Case 2 aButtonHTML(i) = "
" & oRs("B_HTML") & "
" End Select oRs.MoveNext Loop oRs.Close End Sub ' 由按钮代码得到按钮的最终输出 Function Code2HTML(s_Code) Dim i Code2HTML = "" For i = 1 To UBound(aButtonCode) If UCase(aButtonCode(i)) = UCase(s_Code) Then Code2HTML = aButtonHTML(i) Exit Function End If Next End Function ' 初始化工具栏 Sub InitToolBar() Dim aButton, n sSql = "select t_button from ewebeditor_toolbar where s_id=" & sStyleID & " order by t_order asc" oRs.Open sSql, oConn, 0, 1 If Not oRs.Eof Then sToolBar = "" Do While Not oRs.Eof sToolBar = sToolBar & "" oRs.MoveNext Loop sToolBar = sToolBar & "
" aButton = Split(oRs("T_Button"), "|") For n = 0 To UBound(aButton) If sFullScreen = "1" And UCase(aButton(n)) = "MAXIMIZE" Then aButton(n) = "Minimize" End If sToolBar = sToolBar & Code2HTML(aButton(n)) Next sToolBar = sToolBar & "
" Else ShowErr "对应样式没有设置工具栏!" End If oRs.Close End Sub %>