Home  >  Article  >  Backend Development  >  Replace the ecshop background editor with the ueditor editor_PHP tutorial

Replace the ecshop background editor with the ueditor editor_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:04:591171browse

Replace the ecshop background editor with the ueditor editor

This article mainly introduces the detailed process of replacing the ecshop background editor with the ueditor editor. It is recommended here for those who have the same needs. Friends.

1. Download Ueditor1.4.3 (latest version as of 2015-03-03)

Download address: http://ueditor.baidu.com/website/download.html
Download jquery and other related files to resolve jquery conflicts
The file already contains js conflict modification files. In addition, the image saving path in php/config.json has been modified. Users can also modify it themselves!
Because Lao Yang uses a mac os system, there are some .DS_store files in the file, which can be ignored or deleted by yourself
Download address: http://pan.baidu.com/s/1gdglb0J Password: flu (provided by Lao Yang)

2. Upload to the website server

Unzip and upload the directory uediter to the root directory /includes
Unzip Lao Yang’s stuff and upload fix_jquery to the ueditor directory

3. Modify /admin/includes/lib_main.php

Find the function below

The code is as follows:


/**
* Generate editor
* @param string input_name input box name
* @param string input_value input box value
*/
function create_html_editor($input_name, $input_value = '')
{
global $smarty;

$editor = new FCKeditor($input_name);
$editor->BasePath = '../includes/fckeditor/';
$editor->ToolbarSet = 'Normal';
$editor->Width = '100%';
$editor->Height = '320';
$editor->Value = $input_value;
$FCKeditor = $editor->CreateHtml();
$smarty->assign('FCKeditor', $FCKeditor);
}

Replace

with:

The code is as follows:


/**
* Generate editor
* @param string input_name input box name
* @param string input_value input box value
*/
function create_html_editor($input_name, $input_value = '')
{
global $smarty;
$kindeditor="



<script><br> var ue = UE.getEditor('editor');<br> </script>
";
$smarty->assign('FCKeditor', $kindeditor);
}

4. Modify /admin/templates/pageheader.htm

Find:

The code is as follows:


{insert_scripts files="../js/transport.js,common.js,../js/utils.js"}

Replace

with:

The code is as follows:






{insert_scripts files="../js/utils.js"}

5. Solve the bug where the editor is reset during product editing and uedite cannot save the content.

File:/admin/templates/goods_info.htm
Found:

The code is as follows:


document.forms['theForm'].reset();

Comment out:

The code is as follows:


//document.forms['theForm'].reset();

The above is the entire content of this article, I hope you all like it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/964002.htmlTechArticleReplacement of ecshop background editor with ueditor editor This article mainly introduces the replacement of ecshop background editor with ueditor editor The detailed process is recommended here to friends who have the same needs...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn