当前位置:首页 > CMS教程 > ecshop > 列表

ecshop将fckeditor编辑器换成kindEditor

发布:smiling 来源: PHP粉丝网  添加日期:2014-06-14 15:12:31 浏览: 评论:0 

文件:admin/includes/lib_main.php,找到如下代码:

  1. function create_html_editor($input_name, $input_value = '') { 
  2.    global $smarty; 
  3.    $editor = new FCKeditor($input_name); 
  4. $editor->BasePath = '../includes/fckeditor/';  
  5. $editor->ToolbarSet = 'Normal'; 
  6.  $editor->Width = '100%'; 
  7.  $editor->Height = '320'; 
  8.  $editor->Value = $input_value; 
  9.  $FCKeditor = $editor->CreateHtml(); 
  10.  $smarty->assign('FCKeditor', $FCKeditor);  
  11. } 
  12.  
  13. //修改成 
  14. function create_html_editor($input_name, $input_value = '') 
  15. { 
  16. global $smarty; 
  17. $kindeditor="<script charset='utf-8' src='../includes/kindeditor/kindeditor-min.js'></script> 
  18. <script> 
  19. var editor; 
  20. KindEditor.ready(function(K) { 
  21. editor = K.create('textarea[name=\"$input_name\"]', { 
  22. filterMode : false, 
  23. allowFileManager : true, 
  24. width : '700px', 
  25. height: '300px', 
  26. resizeType: 0 
  27. }); 
  28. }); 
  29. </script> 
  30. <textarea id=\"$input_name\" name=\"$input_name\" style='width:700px;height:300px;'>$input_value</textarea> 
  31. "; 
  32. $smarty->assign('FCKeditor', $kindeditor); 
  33. } 

然后再进行修改上传目录修改includes/kindeditor/php/upload_json.php如下:

 

文件保存目录路径:

$save_path = $php_path . '../../../images/upload/';

文件保存目录URL:

$save_url = $php_url . '../../../images/upload/';
浏览服务器路径修改includes/kindeditor/php/file_manager_json.php如下:
根目录路径,可以指定绝对路径,比如 /var/www/attached/

$root_path = $php_path . '../../../images/upload/';

根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/

$root_url = $php_url . '../../../images/upload/';

最后将 admin\templates\goods_info.htm 中 <input type="submit" value="{$lang.button_submit}" class="button" onclick="validate('{$goods.goods_id}')" />; 将 button 改成 submit

Tags: ecshop编辑器 kindEditor

分享到: