JTBC所见即所得UBB编辑器整合 程序: (ASP)JTBC网站内容管理系统(v1.0 Final) UBBEditor (v1.0.0.0) UBB2HTML (ASP) 1.下载安装: http://www.ubbeditor.com/download/ubbeditor/1.0/ubbeditor.tar.gz http://www.ubbeditor.com/download/ubbeditor/1.0/ubb2html/asp.tar.gz ubbeditor.tar.gz里的ubbeditor目录放置在程序的common目录下 asp.tar.gz里的ubb2html.asp文件放置在common\incfiles目录里 头模板添加js:
<script type="text/javascript" src="{$=get_actual_route('common')}/ubbeditor/ubbEditor.js"></script> 各模块index.asp里包含<!--#include file="../common/incfiles/ubb2html.asp"-->(注意路径评论里两个../) 2.调用(以评论为例): 打开support\review.tpl.api模板的input_form节点 文本框替换为: <textarea id="content" name="content" style="width: 600px; height: 300px"></textarea> 代码最后面添加: <script type="text/javascript"> var nEditor = new ubbEditor('content'); nEditor.tLang = 'zh-cn'; nEditor.tToolbar = 'default'; nEditor.tInit('nEditor', '{$=get_actual_route('common')}/ubbeditor/'); </script> output_note节点{$content}替换为{$rcontent} 3.前台显示: 打开support\review\common\incfiles\module_config.asp tmptstr = Replace(tmptstr, "{$content}", encode_article(ubbcode(htmlencode(get_str(rs(cfname("content")))), 0))) 替换为 tmptstr = Replace(tmptstr, "{$content}", ubb2html(get_str(rs(cfname("content"))))) 打开support\review\common\api\review.asp tmptstr = Replace(tmptstr, "{$content}", encode_article(ubbcode(htmlencode(get_str(trs(cfnames(tfpre, "content")))), 0))) 替换为 tmptstr = Replace(tmptstr, "{$rcontent}", ubb2html(get_str(trs(cfnames(tfpre, "content")))))
|