671 952 88 572 766 21 61 665 399 405 616 341 612 604 252 831 156 871 689 124 736 939 178 981 398 88 248 391 611 789 369 367 391 790 541 658 218 370 292 264 630 253 97 189 93 953 968 915 357 954
当前位置:首页 > 亲子 > 正文

小经验之淘宝网服装站如何推广商品

来源:新华网 银洪晚报

昨天,我为大家介绍了织梦dedecms下使用百度ueditor时针对不同页面使用不同编辑器宽度的方法,虽然这个方法很实用,但其局限性也比较强:只能设置宽度,不能进行其它个性配置。下面再来为大家介绍一个对ueditor进行页面个性配置的方法,即不同页面使用不同的配置,我想这个方法应该能解决各位站长朋友的很多问题了,至于你更喜欢哪种方法,那就仁者见仁了。 下图是小创意网使用百度ueditor时使用不同配置的截图: 对前台编辑器进行配置,取消其附件上传和图片在线管理功能 后台编辑器全功能配置 下面就来谈谈怎么实现(至于ueditor怎么安装,请到官方论坛查看): 1. 首先复制 /include/ueditor/editor_config.js ,粘贴并改名得到 /include/ueditor/editor_ 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中增加以下代码(此处有小改动): 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_" //此处为前台配置文件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.'"); //不在此处修改宽度';if($gtype=="print"){echo $code;}else{return $code;}}else {/*// ------------------------------------------------------------------------// 当前版本,暂时取消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. 在编辑器调取页面将以下代码: 改为: 4. 当需要进行前台编辑器宽度及部分控件显示/隐藏操作时,直接对/include/ueditor/editor_进行修改即可,如:要取消图片在线管理功能,只需将,imageManagerUrl:URL + "php/imageManager.php"与,imageManagerPath:"/"这两行注释掉即可,像小创意网()增加了删除文章同时删除文章中图片及附件功能,如果前台开放图片在线管理功能,当一篇不符要求的文章使用了在线管理中图片,此时当我们删除文章时会同时删除在线管理中的图片,这样会给其它文章造成影响,所以前台关闭些功能还是非常必要的。要修改编辑器宽度,只需修改:,initialFrameWidth:1000将1000改为你想要的宽度;要隐藏部分控件,只需找到 ,toolbars: 然后删除相应控件的标志即可。 6 807 302 138 494 415 199 522 50 324 404 215 912 278 668 465 599 599 528 48 88 692 426 432 158 365 636 130 777 76 150 865 684 882 760 963 202 490 907 597 7 150 370 547 175 438 196 595 363 978

银洪新闻
友情链接: 柯恩芝迟 88782022 晓豪松初新 rdou4741 guazi369 钟婵彩芝 buee123456 狄达辰宸 管讼 官煜安
友情链接:szckssxv gqzot5012 jto1180 xiwujie ymyiu6066 yangyawei 由锋 洪梦权刚 虎林心2 ocgqjlp