Dream Dedecms different pages using different Ueditor editor configurations

Source: Internet
Author: User

Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall

Yesterday, I introduced to you the Dream Dedecms under the use of Baidu Ueditor for different pages using different editor width method, although this method is very practical, but its limitations are relatively strong: can only set the width, can not carry out other personality configuration. Here again to introduce a ueditor on the page personalized configuration method, that is, different pages using different configuration, I think this method should be able to solve the webmaster friends a lot of questions, as for you prefer which method, that is the people of the beholder.

The figure below is a screenshot of the use of a different configuration for a small creative web using Baidu Ueditor:

  

Configure the foreground editor to cancel the attachment upload and image online management function

  

Background Editor full feature configuration

Let's talk about how to do it (as for ueditor installation, please go to the official forum to see):

1. First copy/include/ueditor/editor_config.js, paste and rename get/include/ueditor/editor_config1.js

2. Add the following code in the/include/helpers/util.helper.php (here and the previous article):

if (! function_exists (' Geteditord '))

{

function Geteditord ($fname, $fvalue, $nheight = "All", $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. Add the following code in the/include/inc/inc_fun_funadmin.php (here are minor changes):

function Spgeteditord ($fname, $fvalue, $nheight = "All", $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/';


//Get expression information


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


$js script = Array ();


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


{


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


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


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


}


$js script = implode (', ', $js script);


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


}


$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 ">//Here is the foreground profile
<script type=" Text/javascript "charset=" GBK "src=" ". $ globals[' Cfg_cmspath ']. ' /include/ueditor/editor_all_min.js

'. $fvalue. '
<script type= "Text/javascript"
var UE = new Baidu.editor.ui.Editor (); Ue.render ("'. $fname."); Do not modify width
';
if ($gtype = = "Print")
{
echo $code;
}
Else
{
return $code;
}
}
Else {
/*
//------------------------------------------------------------------------
/Current version, Temporarily cancels the support of the Dedehtml editor
//------------------------------------------------------------------------
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. On the editor page, the following code is changed to:

4. When you need to do the foreground editor width and some control display/hide operation, directly to the/INCLUDE/UEDITOR/EDITOR_ Config1.js to modify, such as:
to cancel the image online management function, just will
, Imagemanagerurl:url + "php/imagemanager.php"
and
, Imagemanagerpath: "/"
These two lines are commented out, Like the small creative web (www.smallcy.com) added deleted articles at the same time delete articles in the picture and attachment features, if the front desk opens the picture online management function, when a non-conforming article uses the online management picture, at this time when we delete the article will also delete the online management The picture, will cause the other article to affect, therefore the foreground It is necessary to turn off some features.
To modify the editor width, simply modify:
, initialframewidth:1000
Change 1000 to the width you want;
to hide part of the control, just find it, toolbars: Then delete the flag for the corresponding control.

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.