网站地图    收藏   

主页 > 后端 > ecshop教程 >

ecshop将fckeditor编辑器换成kindEditor - ecshop

来源:自学PHP网    时间:2014-11-28 23:31 作者: 阅读:次

[导读] 文件:admin includes lib_main php,找到如下代码:functioncreate_html_editor($input_name,$input_value= 39; 39;){global$...

ecshop将fckeditor编辑器换成kindEditor

文件: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

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论