Set up fckeditor with Safari 3
Note this article is a couple of years old… I’ve given up on the folks who make fckeditor. We use Firefox now. (Jan 5, 2011)
1. Set the “this.EnableSafari = true ;” in “fckeditor.js”
2. Open the file “fckeditor_php5.php”
Then look for the function called “IsCompatible”
Add a new boolean “else if ( strpos($sAgent, ‘KHTML’) !== false )”
and add:
“$iVersion = (int)substr($sAgent, (72 + 27), 5) ;
return ($iVersion >= 3) ;”
3. Enjoy.
Here’s the function below…
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, ‘KHTML’) !== false )
{
$iVersion = (int)substr($sAgent, (72 + 27), 5) ;
return ($iVersion >= 3) ;
}
else
return false ;
}
NB for Safari 3.1 the line should be:
$iVersion = (int)substr($sAgent, (72 + 32), 3) ;
This line reads the HTTP_USER_AGENT and reads the version number as an integer.










