PHPCMS v9.5.6 integration UEditer1.4.2

Source: Internet
Author: User

Bytes -----------------------------------------------------------------------------------------------

First go to The UEditor official website to download the required version: http://ueditor.baidu.com/website/download.html

Here the 1.4.2 PHP version, the UTF-8 version as an example =>

---------------------------- @ Chenwei integration <www. chenwei. ws> -----------------------

1. decompress the downloaded package, obtain the package directory, and rename the package directory to ueditor.

 

2. Put the ueditor package in PHPCMS_PATH/statics/js. (PHPCMS_PATH is the path of the phpcms entry file)

 

3. modify ueditor/php/config. json: Upload the configuration item path of the uploaded image, the configuration item path of the uploaded graffiti image, the tool upload and save path, capture the remote image save path, upload the video save path, and upload the File Save path: /ueditor/php/upload/image/{yyyy} {mm} {dd}/{time} {rand: 6} changed: /phpcms/uploadfile/{yyyy}/{mm} {dd}/{yyyy} {mm} {dd} {rand: 6}, which complies with the PHPCMS path rules.

Specify the directory for listing images and the directory for listing files:/phpcms/uploadfile/

 

4. Modify the ueditor/ueditor. config. js configuration file,

1) custom toolbar content:, toorbars: [[************]

This toolbar icon you can refer to the official documentation to modify, remove unnecessary features: http://fex.baidu.com/ueditor/#start-toolbar

// All the function buttons and drop-down boxes in the toolbar. You can select the new definition you need when using the new editor instance. toolbars: [['fullscreen ', 'source ', '|', 'undo ', 'redo', '|', 'bold ', 'italic', 'underline', 'fontborder', 'strikethangout', 'superscript ', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain ',' | ', 'forecolor', 'backcolor', 'insertorderedlist ', 'insertunorderedlist', 'selectall', 'cleardoc ',' | ', 'rowspacingtop', 'rowspacingbottom ', 'lineheight',' | ', 'customstyle', 'Paragraph ', 'fontfamily ', 'fontsize',' | ', 'ctionctionalityltr', 'ctionalalityrtl', 'indent ',' | ', 'justifyleft', 'justifycenter', 'justifyright ', 'justifyjustify ',' | ', 'touppercase', 'lowercase',' | ', 'link', 'unlink',' | ', 'simpleupload', 'insertimage ', 'insertvideo', 'music', 'attachment ', 'insertframe', 'pagebar', 'template', 'background', '|', 'horizontal ', 'date ', 'time', 'spechars', 'snapscreen', 'wordimage', '|', 'inserttable', 'deleteable', 'preview', 'searchreact', 'help ', 'drafs']

2) custom editor width/height:, initialFrameWidth: 700 // initialize the editor width. The default value is 1000.

, InitialFrameHeight: 350 // initialize the editor height, 320 by default

 

5. Modify the PC_PATH/libs/classes/form. class. php file,

Convert the original:

if(!defined('EDITOR_INIT')) {    $str = '<script type="text/javascript" src="'.JS_PATH.'ckeditor/ckeditor.js"></script>';    define('EDITOR_INIT', 1);}

Changed:

if(!defined('EDITOR_INIT')) {    $str .= '<script type="text/javascript" src="'.JS_PATH.'ueditor/ueditor.config.js"></script>';    $str .= '<script type="text/javascript" src="'.JS_PATH.'ueditor/ueditor.all.js"></script>';    $str .= '<script type="text/javascript" src="'.JS_PATH.'ueditor/ueditor.parse.js"></script>';    $str .= '<link rel="stylesheet" href="'.JS_PATH.'ueditor/themes/default/css/ueditor.css"/>';    define('EDITOR_INIT', 1);}    $str .= "<script type=\"text/javascript\">\r\n";    $str .= "var editor = UE.getEditor('$textareaid');";    $str .= '</script>';

6. In ueditor/themes/default/css/ueditor.css,

/* UI toolbar, editing area, bottom style */

Add a row: width: auto! Important; // Note: add this line to make the editor adaptive

 

7. Remove the sub-title Display below the editor: remove the following code from phpcms/libs/classes/form. class. php,

$ext_str = "<div class='editor_bottom'>";  if(!defined('IMAGES_INIT')) {  $ext_str .= '<script type="text/javascript" src="'.JS_PATH.'swfupload/swf2ckeditor.js"></script>';  define('IMAGES_INIT', 1);}  $ext_str .= "<div id='page_title_div'>  <table cellpadding='0' cellspacing='1' border='0'><tr><td class='title'>".L('subtitle')."<span id='msg_page_title_value'></span></td><td>  <a class='close' href='javascript:;' onclick='javascript:$(\"#page_title_div\").hide();'><span>×</span></a></td>  <tr><td colspan='2'><input name='page_title_value' id='page_title_value' class='input-text' value='' size='30'>&nbsp;<input type='button' class='button' value='".L('submit')."' onclick=insert_page_title(\"$textareaid\",1)></td></tr>  </table></div>";  $ext_str .= "</div>";

8. Modify the display of the content in the editor:

Statics/js/ueditor/themes/default/css/ueditor.css

. Edui-default. edui-editor-iframeholder {
Position: relative;
Width: auto! Important; // Add a new row

 

9. solve the problem that the editor floats above the release button:

Modify the. fixed-bottom. fixed-but {} property under statics/css/zh-cn-system.css and add z-index: 2000;

Bytes ------------------------------------------------------------------------------------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.