eshoweditor编辑器可以直接使用文档的图片,从本地电脑复制内容到帝国cms后台后图片就自动加载了,特别适合政府学校类编辑人员,他们有大量的文档图,换成eshoweditor编辑器可以减少工作量。购买eshoweditor编辑器后,还需要在帝国cms文件里修改一下代码,下面是青青模板网整理的解决方法,供大家学习参考:7fS电脑_数码_手机应用问题解决的IT技术网站seo – 云狐网

7fS电脑_数码_手机应用问题解决的IT技术网站seo – 云狐网

只需要修改公用调用的地方,也就是e/admin/ecmseditor/eshoweditor.php 这个文件里的代码7fS电脑_数码_手机应用问题解决的IT技术网站seo – 云狐网

7fS电脑_数码_手机应用问题解决的IT技术网站seo – 云狐网

7fS电脑_数码_手机应用问题解决的IT技术网站seo – 云狐网

注释的是原来的,下面是改后的。7fS电脑_数码_手机应用问题解决的IT技术网站seo – 云狐网

完整代码:7fS电脑_数码_手机应用问题解决的IT技术网站seo – 云狐网

  1. <?php 
  2.    
  3. //变量名,变量值,工具条模式,编辑器目录,高度,宽度,全页 
  4. function ECMS_ShowEditorVar($varname,$varvalue,$toolbar=‘full’,$basepath=”,$height=‘300’,$width=‘100%’,$fullpage=0){ 
  5.     global $eshoweditorhtml; 
  6.     $toolbar=strtolower($toolbar); 
  7.     if($varvalue) 
  8.     { 
  9.         $varvalue=ehtmlspecialchars($varvalue); 
  10.     } 
  11.     if(emptyempty($basepath)) 
  12.     { 
  13.         $basepath=‘ecmseditor/infoeditor/’; 
  14.     } 
  15.     if(emptyempty($height)) 
  16.     { 
  17.         $height=‘300’; 
  18.     } 
  19.     if(emptyempty($width)) 
  20.     { 
  21.         $width=‘100%’; 
  22.     } 
  23.     $editorvars=”; 
  24.     if($fullpage==1) 
  25.     { 
  26.         $editorvars.=“fullPage:true, “; 
  27.     } 
  28.     if($toolbar==‘basic’) 
  29.     { 
  30.         $editorvars.=“toolbar:’basic’, “; 
  31.     } 
  32.     if($eshoweditorhtml) 
  33.     { 
  34.         $editorvars.=“startupMode:’source’, “; 
  35.     } 
  36.     $editorvars.=“width:'”.$width.“‘, height:'”.$height.“‘”; 
  37.    
  38. //    $echoeditor=”<textarea cols=’90’ rows=’10’ id='”.$varname.”‘ name='”.$varname.”‘>”.$varvalue.”</textarea> 
  39. //<script type=’text/javascript’>CKEDITOR.replace(‘”.$varname.”‘, 
  40. //{ 
  41. //     “.$editorvars.” 
  42. //});</script>”; 
  43.    
  44.     $echoeditor=“<textarea cols=’90’ rows=’10’ id='”.$varname.“‘ name='”.$varname.“‘>”.$varvalue.”</textarea> 
  45. <script type=‘text/javascript’>EWEBEDITOR.Replace(‘”.$varname.”‘,{style:‘coolblue’, width:‘”.$width.”‘, height:‘”.$height.”‘}); 
  46. </script>”; 
  47.    
  48.     return $echoeditor; 
  49. } 
  50.    
  51. //返回加载JS文件 
  52. function ECMS_ShowEditorJS($basepath=”){ 
  53.     if(emptyempty($basepath)) 
  54.     { 
  55.         $basepath=‘ecmseditor/infoeditor/’; 
  56.     } 
  57.     $addcs=ECMS_ReturnEditorCx(); 
  58.    
  59.     //$loadjs='<input type=hidden id=doecmseditor_eaddcs value=”‘.$addcs.'”> <script type=”text/javascript” src=”‘.$basepath.’ckeditor.js?&empirecms=1″></script>’; 
  60.     $loadjs=‘<input type=hidden id=doecmseditor_eaddcs value=”‘.$addcs.‘”> <script type=”text/javascript” src=”/e/admin/ewebeditor/ewebeditor.js”></script>’; 
  61.    
  62.     return $loadjs; 
  63. } 
  64.    
  65. //附加参数 
  66. function ECMS_ReturnEditorCx(){ 
  67.     global $classid,$filepass,$id,$r,$enews,$ecms_hashur; 
  68.     if($enews==‘AddClass’||$enews==‘EditClass’) 
  69.     { 
  70.         $modtype=1; 
  71.     } 
  72.     elseif($enews==‘AddZt’||$enews==‘EditZt’) 
  73.     { 
  74.         $modtype=2; 
  75.     } 
  76.     else 
  77.     { 
  78.         $modtype=0; 
  79.     } 
  80.     $classid=(int)$classid; 
  81.     $filepass=(int)$filepass; 
  82.     $id=(int)$id; 
  83.     $modtype=(int)$modtype; 
  84.     $str=“&classid=$classid&filepass=$filepass&infoid=$id&modtype=$modtype&sinfo=1”.$ecms_hashur[‘ehref’]; 
  85.     return $str; 
  86. } 
  87.    
  88. //上传提示 
  89. function ECMS_PTEditorShowError($type,$error,$showstr,$add,$ecms=0){ 
  90. ?> 
  91. <script type=‘text/javascript’> 
  92. <?php 
  93. if($error) 
  94. { 
  95.     echo‘alert(“‘.$error.‘”);’; 
  96. } 
  97. if($showstr&&$showstr!=‘####’) 
  98. { 
  99.     echo“window.parent.EcmsEditorReturnDoAction”.$type.“(‘”.addslashes($showstr).“‘);”; 
  100. } 
  101. ?> 
  102. </script> 
  103. <?php 
  104. } 
  105.    
  106. //返回type 
  107. function ECMS_EditorReturnType($page){ 
  108.     if(emptyempty($page)) 
  109.     { 
  110.         $page=$_POST[‘doecmspage’]?$_POST[‘doecmspage’]:$_GET[‘doecmspage’]; 
  111.     } 
  112.     if($page==‘TranFile’) 
  113.     { 
  114.         $r[‘ftype’]=0; 
  115.         $r[‘jsfun’]=‘EHEcmsEditorDoTranFile’; 
  116.     } 
  117.     elseif($page==‘TranFlash’) 
  118.     { 
  119.         $r[‘ftype’]=2; 
  120.         $r[‘jsfun’]=‘EHEcmsEditorDoTranFlash’; 
  121.     } 
  122.     elseif($page==‘TranMedia’) 
  123.     { 
  124.         $r[‘ftype’]=3; 
  125.         $r[‘jsfun’]=‘EHEcmsEditorDoTranMedia’; 
  126.     } 
  127.     elseif($page==‘TranMore’) 
  128.     { 
  129.         $r[‘ftype’]=‘TM’; 
  130.         $r[‘jsfun’]=‘EHEcmsEditorDoTranMore’; 
  131.     } 
  132.     elseif($page==‘TranImg2’) 
  133.     { 
  134.         $r[‘ftype’]=1; 
  135.         $r[‘jsfun’]=‘EHEcmsEditorDoTranImgTwo’; 
  136.     } 
  137.     else    //TranImg 
  138.     { 
  139.         $r[‘ftype’]=1; 
  140.         $r[‘jsfun’]=‘EHEcmsEditorDoTranImg’; 
  141.     } 
  142.     return $r; 
  143. } 
  144.    
  145. //选择提示 
  146. function ECMS_EditorChFileFun($page){ 
  147.     $r=ECMS_EditorReturnType($page); 
  148.     return $r[‘jsfun’]; 
  149. } 
  150.    
  151. ?> 
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。