Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 05:53 am EST
Geeklog Forums
Safari FCKeditor work around?
kyngchaos
Anonymous
Here's what I came up with.
First, you need a browser detector. I didn't find any builtin GL functions for this, so I used one I've used in the past: go to App Creator and download the Visitor Sniffer. It's a little old, but it gets Safari just fine. Put sniffer.php into the GL system/classes folder, that makes it easy for GL to find.
Now, edit system/lib-custom.php and add this at the end, before the final "?>" line:
require_once( $_CONF['path_system'] . 'classes/sniffer.php' );
$theBrowser = new sniffer();
if( isset( $_CONF['advanced_editor'] ) && ( $_CONF['advanced_editor'] == 1 )
&& ($theBrowser->browser == "Safari"))
{ $_CONF['advanced_editor'] = false; }
This could be expanded, and maybe added to the GL distro. There would be a config option that goes along with enabling the advanced editor to set a list of browsers to disable the advanced editor in. Even when it works for Safari in the future, updates could cause problems for Safari, or any other browser, and this would be a quick config change to temporarily disable it in those browsers until it works again.
First, you need a browser detector. I didn't find any builtin GL functions for this, so I used one I've used in the past: go to App Creator and download the Visitor Sniffer. It's a little old, but it gets Safari just fine. Put sniffer.php into the GL system/classes folder, that makes it easy for GL to find.
Now, edit system/lib-custom.php and add this at the end, before the final "?>" line:
Text Formatted Code
/* Browser sniffer to disable advanced editor for Safari */require_once( $_CONF['path_system'] . 'classes/sniffer.php' );
$theBrowser = new sniffer();
if( isset( $_CONF['advanced_editor'] ) && ( $_CONF['advanced_editor'] == 1 )
&& ($theBrowser->browser == "Safari"))
{ $_CONF['advanced_editor'] = false; }
This could be expanded, and maybe added to the GL distro. There would be a config option that goes along with enabling the advanced editor to set a list of browsers to disable the advanced editor in. Even when it works for Safari in the future, updates could cause problems for Safari, or any other browser, and this would be a quick config change to temporarily disable it in those browsers until it works again.
10
11
Quote
All times are EST. The time is now 05:53 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content