乱码乱a∨中文字幕,在线免费激情视频,亚洲欧美久久夜夜潮,国产在线网址

  1. <sub id="hjl7n"></sub>

    1. <sub id="hjl7n"></sub>

      <legend id="hjl7n"></legend>

      當(dāng)前位置:首頁(yè) >  站長(zhǎng) >  建站經(jīng)驗(yàn) >  正文

      織夢(mèng)dedecms不同頁(yè)面使用不同ueditor編輯器配置

       2013-04-17 22:31  來(lái)源: 小創(chuàng)意網(wǎng)   我來(lái)投稿 撤稿糾錯(cuò)

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

      昨天,我為大家介紹了織夢(mèng)dedecms下使用百度ueditor時(shí)針對(duì)不同頁(yè)面使用不同編輯器寬度的方法,雖然這個(gè)方法很實(shí)用,但其局限性也比較強(qiáng):只能設(shè)置寬度,不能進(jìn)行其它個(gè)性配置。下面再來(lái)為大家介紹一個(gè)對(duì)ueditor進(jìn)行頁(yè)面?zhèn)€性配置的方法,即不同頁(yè)面使用不同的配置,我想這個(gè)方法應(yīng)該能解決各位站長(zhǎng)朋友的很多問(wèn)題了,至于你更喜歡哪種方法,那就仁者見(jiàn)仁了。

      下圖是小創(chuàng)意網(wǎng)使用百度ueditor時(shí)使用不同配置的截圖:

      對(duì)前臺(tái)編輯器進(jìn)行配置,取消其附件上傳和圖片在線管理功能

      后臺(tái)編輯器全功能配置

      下面就來(lái)談?wù)勗趺磳?shí)現(xiàn)(至于ueditor怎么安裝,請(qǐng)到官方論壇查看):

      1. 首先復(fù)制 /include/ueditor/editor_config.js ,粘貼并改名得到 /include/ueditor/editor_config1.js

      2. 在/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);

      }

      }

      3. 在 /include/inc/inc_fun_funAdmin.php中增加以下代碼(此處有小改動(dòng)):

      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=='' ? '

      ' : $fvalue;
      $code = '<script type="text/javascript" charset="gbk" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/editor_config1.js"> //此處為前臺(tái)配置文件
      <script type="text/javascript" charset="gbk" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/editor_all_min.js">


      <script type="text/javascript">
      var ue = new baidu.editor.ui.Editor();ue.render("'.$fname.'"); //不在此處修改寬度
      ';
      if($gtype=="print")
      {
      echo $code;
      }
      else
      {
      return $code;
      }
      }
      else {
      /*
      // ------------------------------------------------------------------------
      // 當(dāng)前版本,暫時(shí)取消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)取頁(yè)面將以下代碼:

      改為:

      4. 當(dāng)需要進(jìn)行前臺(tái)編輯器寬度及部分控件顯示/隱藏操作時(shí),直接對(duì)/include/ueditor/editor_config1.js進(jìn)行修改即可,如:
      要取消圖片在線管理功能,只需將
      ,imageManagerUrl:URL + "php/imageManager.php"

      ,imageManagerPath:"/"
      這兩行注釋掉即可,像小創(chuàng)意網(wǎng)(www.smallcy.com)增加了刪除文章同時(shí)刪除文章中圖片及附件功能,如果前臺(tái)開(kāi)放圖片在線管理功能,當(dāng)一篇不符要求的文章使用了在線管理中圖片,此時(shí)當(dāng)我們刪除文章時(shí)會(huì)同時(shí)刪除在線管理中的圖片,這樣會(huì)給其它文章造成影響,所以前臺(tái)關(guān)閉些功能還是非常必要的。
      要修改編輯器寬度,只需修改:
      ,initialFrameWidth:1000
      將1000改為你想要的寬度;
      要隱藏部分控件,只需找到 ,toolbars: 然后刪除相應(yīng)控件的標(biāo)志即可。

      申請(qǐng)創(chuàng)業(yè)報(bào)道,分享創(chuàng)業(yè)好點(diǎn)子。點(diǎn)擊此處,共同探討創(chuàng)業(yè)新機(jī)遇!

      相關(guān)文章

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

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

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

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

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

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

        標(biāo)簽:
        ueditor編輯器
      • 為織夢(mèng)dedecms不同頁(yè)面中百度ueditor編輯器設(shè)置不同寬度

        相信正在使用織夢(mèng)dedecms作為網(wǎng)站管理程序的站長(zhǎng)朋友對(duì)織夢(mèng)自帶的ckeditor編輯器一定感到非常糾心:其難看的外觀,不太好用的添加視頻功能,超級(jí)弱智的圖片上傳項(xiàng),就連按個(gè)tab鍵都要跳出編輯框...這些無(wú)不讓我們對(duì)其深惡痛絕(可能說(shuō)得有點(diǎn)夸張)!本人最近開(kāi)了一個(gè)

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

      熱門(mén)排行

      信息推薦