婷婷久久综合九色综合,欧美成色婷婷在线观看视频,偷窥视频一区,欧美日本一道道一区二区

<tt id="bu9ss"></tt>
  • <span id="bu9ss"></span>
  • <pre id="bu9ss"><tt id="bu9ss"></tt></pre>
    <label id="bu9ss"></label>

    當(dāng)前位置:首頁 >  站長 >  建站經(jīng)驗 >  正文

    為織夢dedecms不同頁面中百度ueditor編輯器設(shè)置不同寬度

     2013-04-16 16:48  來源: 小創(chuàng)意   我來投稿 撤稿糾錯

      阿里云優(yōu)惠券 先領(lǐng)券再下單

           相信正在使用織夢dedecms作為網(wǎng)站管理程序的站長朋友對織夢自帶的ckeditor編輯器一定感到非常糾心:其難看的外觀,不太好用的添加視頻功能,超級弱智的圖片上傳項,就連按個"tab"鍵都要跳出編輯框...這些無不讓我們對其深惡痛絕(可能說得有點夸張)!

           本人最近開了一個新站,最初因為這個ckeditor編輯器給編輯工作帶來了諸多不便,所以最后痛下決心:改成百度ueditor。

           為什么改成ueditor而不是別的編輯器呢?原因主要有三點:

           一、ueditor界面相當(dāng)美觀,用起來舒服;

           二、功能強悍,比如圖片上傳功能:它支持批量上傳,圖片搜索,還有非常不錯的圖片管理器;再比如視頻添加功能:直接填寫優(yōu)酷土豆等視頻網(wǎng)址即可,不用像ckeditor那樣非常麻煩地去找".swf"flash地址;

           三、基于百度雄厚的實力,相信這個ueditor功能也會越來越強大。

          是不是心動了?想體驗ueditor的朋友可以去我的小創(chuàng)意網(wǎng)(www.smallcy.com)看看,相信會帶給你不錯的體驗。

          不過ueditor裝上后也不是馬上就能用的(至于怎么安裝,大家可以在官方論壇上找),一般都會存在一些小問題。下面我就來談?wù)勂渲幸粋€非常重要的問題的解決方案。

           安裝完ueditor后,我們可以在ueditor的配置文件中對其界面寬度進行設(shè)置,但問題就出在這里,在這里設(shè)置的寬度是對全局而言,即所有網(wǎng)站內(nèi)的編輯器寬度都一樣。但對于我們dedecms用戶而言,一般前臺和后臺編輯器寬度不一致,這樣就會造成編輯器越界的問題。解決方案:將ueditor寬度設(shè)置放在編輯器調(diào)用階段,具體做法如下:

    1. /include/helpers/util.helper.php中增加以下代碼:

    if ( ! function_exists('GetEditorD'))

    {

        function GetEditorD($fname, $fvalue, $nheight="350", $etype="Basic", $gtype="print", $isfullpage="FALSE",$bbcode=false)

        {

            if(!function_exists('SpGetEditorD'))

            {

                require_once(DEDEINC."/inc/inc_fun_funAdmin.php");

            }

            return SpGetEditorD($fname, $fvalue, $nheight, $etype, $gtype, $isfullpage, $bbcode);

        }

    }

    2. /include/inc/inc_fun_funAdmin.php中增加以下代碼:

    function SpGetEditorD($fname,$fvalue,$nheight="350",$etype="Basic",$gtype="print",$isfullpage="false",$bbcode=false)

    {

        global $cfg_ckeditor_initialized;

        if(!isset($GLOBALS['cfg_html_editor']))

        {

            $GLOBALS['cfg_html_editor']='fck';

        }

        if($gtype=="")

        {

            $gtype = "print";

        }

        if($GLOBALS['cfg_html_editor']=='fck')

        {

            require_once(DEDEINC.'/FCKeditor/fckeditor.php');

            $fck = new FCKeditor($fname);

            $fck->BasePath        = $GLOBALS['cfg_cmspath'].'/include/FCKeditor/' ;

            $fck->Width        = '100%' ;

            $fck->Height        = $nheight ;

            $fck->ToolbarSet    = $etype ;

            $fck->Config['FullPage'] = $isfullpage;

            if($GLOBALS['cfg_fck_xhtml']=='Y')

            {

                $fck->Config['EnableXHTML'] = 'true';

                $fck->Config['EnableSourceXHTML'] = 'true';

            }

            $fck->Value = $fvalue ;

            if($gtype=="print")

            {

                $fck->Create();

            }

            else

            {

                return $fck->CreateHtml();

            }

        }

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

        {

            require_once(DEDEINC.'/ckeditor/ckeditor.php');

            $CKEditor = new CKEditor();

            $CKEditor->basePath = $GLOBALS['cfg_cmspath'].'/include/ckeditor/' ;

            $config = $events = array();

            $config['extraPlugins'] = 'dedepage,multipic,addon';

              if($bbcode)

              {

                   $CKEditor->initialized = true;

                   $config['extraPlugins'] .= ',bbcode';

                   $config['fontSize_sizes'] = '30/30%;50/50%;100/100%;120/120%;150/150%;200/200%;300/300%';

                   $config['disableObjectResizing'] = 'true';

                   $config['smiley_path'] = $GLOBALS['cfg_cmspath'].'/images/smiley/';

                   // 獲取表情信息

                   require_once(DEDEDATA.'/smiley.data.php');

                   $jsscript = array();

                   foreach($GLOBALS['cfg_smileys'] as $key=>$val)

                   {

                        $config['smiley_images'][] = $val[0];

                        $config['smiley_descriptions'][] = $val[3];

                        $jsscript[] = '"'.$val[3].'":"'.$key.'"';

                   }

                   $jsscript = implode(',', $jsscript);

                   echo jsscript('CKEDITOR.config.ubb_smiley = {'.$jsscript.'}');

              }

     

            $GLOBALS['tools'] = empty($toolbar[$etype])? $GLOBALS['tools'] : $toolbar[$etype] ;

            $config['toolbar'] = $GLOBALS['tools'];

            $config['height'] = $nheight;

            $config['skin'] = 'kama';

            $CKEditor->returnOutput = TRUE;

            $code = $CKEditor->editor($fname, $fvalue, $config, $events);

            if($gtype=="print")

            {

                echo $code;

            }

            else

            {

                return $code;

            }

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

    {

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

            $code = '<script type="text/javascript" charset="gbk" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/editor_config.js"></script>

            <script type="text/javascript" charset="gbk" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/editor_all_min.js"></script>

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

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

            <script type="text/javascript">

            var ue = new baidu.editor.ui.Editor({ initialFrameWidth:824 });ue.render("'.$fname.'");     //紅色處為修改寬度

            </script>';

            if($gtype=="print")

            {

                    echo $code;

            }

            else

            {

                    return $code;

            }

    }

     

        else {

            /*

            // ------------------------------------------------------------------------

            // 當(dāng)前版本,暫時取消dedehtml編輯器的支持

            // ------------------------------------------------------------------------

            require_once(DEDEINC.'/htmledit/dede_editor.php');

            $ded = new DedeEditor($fname);

            $ded->BasePath        = $GLOBALS['cfg_cmspath'].'/include/htmledit/' ;

            $ded->Width        = '100%' ;

            $ded->Height        = $nheight ;

            $ded->ToolbarSet = strtolower($etype);

            $ded->Value = $fvalue ;

            if($gtype=="print")

            {

                $ded->Create();

            }

            else

            {

                return $ded->CreateHtml();

            }

            */

        }

    }

    3. 在編輯器調(diào)取頁面將以下代碼:

    <?php GetEditor("body","",350,"Member"); ?>

    改為:

    <?php GetEditorD("body","",350,"Member"); ?>

    以上方案的思想是:在不同界面使用不同的編輯器調(diào)用函數(shù)。

    當(dāng)然你可以根據(jù)需要對以上代碼進行刪改,還有什么問題可以去小創(chuàng)意網(wǎng)(www.smallcy.com)咨詢。

    申請創(chuàng)業(yè)報道,分享創(chuàng)業(yè)好點子。點擊此處,共同探討創(chuàng)業(yè)新機遇!

    相關(guān)文章

    • Linux編輯器選什么好 vi還是vim程序編輯器

      Linux下的編輯器非常的多,相信接觸過Linux的朋友用的編輯器大都是emacs,pico,nano,joe,與vim等,我們是不是只需要掌握其中之一就可以了呢?答案并不是這樣,畢竟不同的linux發(fā)行版本內(nèi)置的文本編輯器是不同的。

    • UltraEdit編輯器的快捷使用小技巧

      UltraEdit是一款功能非常強的文本編輯器,可以說能滿足一切需求,可以完成記事本不能處理的需求,比如:ASCLL碼、十六進制、代碼折疊、代碼單詞拼寫檢查、語法加亮以及文本編輯等。那么,接下來就詳細說下UltraEdit的使用技巧。

    • js獲取UEditor富文本編輯器中的圖片地址

      這篇文章主要介紹了js獲取UEditor富文本編輯器中的圖片地址,最簡單的思路應(yīng)該是先獲取UEditor中的內(nèi)容再將獲取到的字符串轉(zhuǎn)換成jquery對象,選擇器找到img元素,獲取src值。

      標(biāo)簽:
      ueditor編輯器
    • 織夢dedecms不同頁面使用不同ueditor編輯器配置

      昨天,我為大家介紹了織夢dedecms下使用百度ueditor時針對不同頁面使用不同編輯器寬度的方法,雖然這個方法很實用,但其局限性也比較強:只能設(shè)置寬度,不能進行其它個性配置。下面再來為大家介紹一個對ueditor進行頁面?zhèn)€性配置的方法,即不同頁面使用不同的配置,我想

      標(biāo)簽:
      ueditor編輯器

    熱門排行

    信息推薦