标签:fckeditor

浏览模式: 标准 | 列表 | 图文
旧贴:fck在chrome下能正常显示

旧贴:fck在chrome下能正常显示

迁移的时候发现,后台的fck编辑器出不来。以前是用firefox的所以没问题,后来也是在使用chrome的时候才有注意(新版的fckEditor早就没有这个问题了,新版已经叫CKEditor了)

1、修改admin/editor/fckeditor_php5.php ,现在应该没有人用4了,直接改5,

function IsCompatible()
{
global $HTTP_USER_AGENT;

if(isset($HTTP_USER_AGENT)){
$sAgent = $HTTP_USER_AGENT;
} else{
$sAgent = $_SERVER['HTTP_USER_AGENT'];
}

if(strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false){
$iVersion = (float) substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3);
return ($iVersion >= 5.5);
} else{
if(strpos($sAgent, 'Gecko/') !== false){
$iVersion = (int) substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8);
return ($iVersion >= 20030210);
} else{
if(strpos($sAgent, 'Opera/') !== false){
$fVersion = (float) substr($sAgent, strpos($sAgent, 'Opera/') + 6, 4);
return ($fVersion >= 9.5);
} else{
if(preg_match("|AppleWebKit/(\d+)|i", $sAgent, $matches)){
$iVersion = $matches[1];
return ($matches[1] >= 522);
} else{
return false;
}
}
}
}
}

2、修改fckeditor.js,将两个配置的False改为true即可:

this.EnableSafari = true ; // This is a temporary property, while Safari support is under development.
this.EnableOpera = true ;

这两个默认是false,改为true即可。

再打开sablog的后台,就OK了。

--------纯记录,下次再手贱的时候就不需要折腾N久了

修复:使用chrome在Sablog里面发博文

原来我一直以为不能够在chrome下的Sablog里面使用fck editor,直到coolcode.cn的andot在群里说改了点东西就支持了。

原来fckeditor.js里面有

this.enableSafari =false;
this.enableOpera = false;

于是,将这两行改成了true;

然后修改那两个PHP文件,在IsCompatible方面里面的判断加上

else if ( strpos($sAgent, 'Opera/') !== false )
{
$fVersion = (float)substr($sAgent, strpos($sAgent, 'Opera/') + 6, 4) ;
return ($fVersion >= 9.5) ;
}
else if ( preg_match( "|AppleWebKit/(\d+)|i", $sAgent, $matches ) )
{
$iVersion = $matches[1] ;
return ( $matches[1] >= 522 ) ;
}

于是,世界清静多了,菜单也出来了。

感谢andot给我们提供的方法。。。

不愿意手工改的朋友,可以直接到:

http://www.coolcode.cn/show-305-1.html

进行下载。good Luck for you