网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

phpcms文章一键排版

  1. phpcms/libs/classes/form.class.php找['Maximize'],在它下面添加['autoformat']

    专注于为中小企业提供成都网站设计、成都网站制作服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业尚义免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了上千多家企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。

    phpcms 文章一键排版

  2. statics/js/ckeditor/config.js找到config.extraPlugins修改为

    config.extraPlugins = 'capture,autoformat';phpcms 文章一键排版

  3. statics\js\ckeditor\plugins 新建文件夹autoformat并新建文件plugin.js

  4. (function() {
        CKEDITOR.plugins.add('autoformat', {
            requires: ['styles', 'button'],
            init: function(a) {
                a.addCommand('autoformat', CKEDITOR.plugins.autoformat.commands.autoformat);
                a.ui.addButton('autoformat', {
                    label: "清除格式,一键排版",
                    command: 'autoformat',
                    //这个autoformat.gif是你的插件图标,放在同目录下 
                    icon: this.path + "autoformat.gif"
                });
            }
        });
        CKEDITOR.plugins.autoformat = {
            commands: {
                autoformat: {
                    exec: function(a) {
                        var _html = a.getData();
                        //清除样式代码 
                        _html = _html.replace(/
    /ig, '

    ');                     _html = _html.replace(/]*>/ig, '');                     _html = _html.replace(/<\/strong>/ig, '');                     _html = _html.replace(/]*>/ig, '');                     _html = _html.replace(/<\/em>/ig, '');                     _html = _html.replace(/]*>/ig, '');                     _html = _html.replace(/<\/u>/, '');                     _html = _html.replace(/]*>/ig, '');                     _html = _html.replace(/<\/li>/ig, '');                     _html = _html.replace(/]*>/ig, '');                     _html = _html.replace(/<\/span>/ig, '');                     _html = _html.replace(/ /ig, '');                     _html = _html.replace(/ /ig, '');                     _html = _html.replace(/

    <\/p>/ig, '');                     _html = _html.replace(/                      _html = _html.replace(/]*>/ig, '');                     _html = _html.replace(/<\/p>/ig, '');                     _html = _html.replace(//ig, '');                     _html = _html.replace(/[\n]/ig, '');                     //按分组,将换行
    全部替换成p标签                      bb = _html.split("");                     aa = '';                     for (var i = 0; i < bb.length; i++) {                         aa = aa + '

    ' + bb[i] + '

    ';                     }                     //首行缩进                      _html = aa.replace(/]*>/ig, '

      ');                     _html = _html.replace(/

      <\/p>/ig, '');                     _html = _html.replace(/

    <\/p>/ig, '');                     //在这里执行你将_html中的空行替换掉的操作                      a.setData(_html);                 }             }         }     }; })();

附件:http://down.51cto.com/data/2366632

网站栏目:phpcms文章一键排版
当前地址:
http://bjjierui.cn/article/iisgjj.html

其他资讯