CKEditor4 添加插入各大视频网站插件

CKEditor4 添加插入各大视频网站插件,第1张

参考链接:

https://docs.ckeditor.com/ckeditor4/docs/#!/guide/dev_media_embed

https://iframely.com/

https://iframely.com/docs/ckeditor

个人认为是调用问题 include/ckeditor/ckeditor.inc.php$toolbar['Member'] = array( array( 'Source','-'), array( 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'), array( 'Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'), array( 'Bold','Italic','Underline','Strike','-'), array( 'Table','HorizontalRule'), array( 'Link','Unlink','Image','Anchor'), array( 'Styles','Format','Font','FontSize'), array( 'TextColor', 'BGColor') )

一、下载ueditor

请自己下载ueditor版本(本人是PHP版本 UFT-8版,不包含_examples、_src等文件夹及文件)。下载完成后,会得到以下这样的目录结构的:

ueditor文件说明:

dialogs 是存放各个d出窗口应用功能的文件,包含html,js

lang 是存放编辑器语言的文件,有中文和E文

php 是存放文件上传、涂鸦、远程图片、在线图片管理,添加视频的php源码文件,可以按自己的需求修改

themes 当然就是主题样式图片存放的地方

third-party 是第三方插件文件存放地方。

editor.all.js 此文件是所有_src里的js源码的合集

editor.all.min.js 此文件是editor_all.js的压缩版

editor.config.js 此文件是UE的配置文件

editor.parse.js 此文件是UE的解析文件

editor.parse.min.js 此文件是UE的解析压缩文件

二、重命名文件夹名称,并复制UE到dede

重命名:ueditor1_3_6-utf8-php,为ueditor。将ueditor全部复制到dede的include文件夹下!完成后ueditor在dede里边的结构如下图:

三、修改 include/inc/inc_fun_funAdmin.php 让 DD 能够调用到 UE

打开 include/inc/inc_fun_funAdmin.php ,大约150行,有个function SpGetEditor,这是DD调用编辑器的,我们要修改它,达到能够调用UE,下拉到226行左右,加上以下代码:

//百度编辑器

 else if($GLOBALS['cfg_html_editor']=='ueditor')

    {

        $fvalue = $fvalue=='' ? '<p></p>' : $fvalue

        $code = '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.config.js"></script>'

        $code .= '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.all.min.js"></script>'

        $code .= '<link rel="stylesheet" type="text/css" href="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/themes/default/css/ueditor.css"/>'

        //$code .= '<textarea name="'.$fname.'" id="'.$fname.'" style="width:100%">'.$fvalue.'</textarea>'

        $code .= '<script type="text/plain" name="'.$fname.'" id="'.$fname.'">'.$fvalue.'</script>'

        if($bbcode)

        {

            $code .= '<script type="text/javascript">UE.getEditor("'.$fname.'",{toolbars:[["Source","|",

        "bold", "italic", "underline","|","fontsize","forecolor","emotion","Undo", "Redo"]],initialFrameHeight:100})</script>'

        }

        else

        {

            $code .= '<script type="text/javascript">UE.getEditor("'.$fname.'",{initialFrameHeight:450})</script>'

        }          

  

        if($gtype=="print")

        {

            echo $code

        }

        else

        {

            return $code

        }

    }//bd end


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/11885955.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-19
下一篇2023-05-19

发表评论

登录后才能评论

评论列表(0条)

    保存