WYSIWYG Editor Problems

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
harlemangel
New Member
New Member
Posts: 8
Joined: Wed Aug 30, 2006 9:06 am

Re: WYSIWYG Editor Problems

Post by harlemangel »

broony wrote: Apparently this is fixed in svn?
Anyone know the correct procedure for upgrading FCK without the super easy to use module manager. I have tried overwriting files with fck installed plus just copying files over after removal of fck.. the result is no appearance of FCK in admin
Any help really  apprecaited
Many thanks
You have to uninstall the old version of FCK editor first - this will simply uninstall it from CMSMS (it wont remove the files on the server). Then either install the new version with using XML upload, or FTP the new version into the modules folder.

What I do to test out new versions is to rename the old version to FCKEditorX_Old and copy over the new version and install it through the module manager.

Simply overwriting the files wont work, as the versions are different. CMSMS will be looking for the old version. You need to unstall first.

One q - how do you apply fixes that are in SVN to the current version that you have locally?
TimothyFoo
Forum Members
Forum Members
Posts: 44
Joined: Wed Oct 12, 2005 8:50 pm

Re: WYSIWYG Editor Problems

Post by TimothyFoo »

I have solved this issue. If your server has auto starting of sessions turned off, you need to turn it back on. FCK Editor needs a session in order to browse the server.

Add the following to your php.ini...

setting session.auto_start = 1

I actually discovered this working on a .Net application, where session state was set to off in the web.config (iis 6.0)

I have ever have any trouble with FCK Editor, check out their wiki.
Raquel

Re: WYSIWYG Editor Problems

Post by Raquel »

I can't access my php.ini on my host.
So apparently I will need to install my own php to make the change. 
Can anyone else confirm this fix works before I d this. Is there any other way?
Raquel

Re: WYSIWYG Editor Problems

Post by Raquel »

Anyone?

To clarify:: I can't test this last suggestion as my host won't change the php.ini from default.

Is there anyone out there knows of a simple local over-ride of the php.ini setting. ( I host with dreamhost)

Otherwise if anyone else can really confirm this solution works (I tried all the rest!) I will make the change by installing a custom php on my domain.

They don't support custom php.ini  though...which is not ideal...
aksival

Re: WYSIWYG Editor Problems

Post by aksival »

You have to change the connector implementation you want to use...the default is ASP.

fckcongif.js (~ line 214)

Code: Select all

var _FileBrowserLanguage	= 'php' ;	// asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage	= 'php' ;	// asp | aspx | cfm | lasso | php
Best,
aksival
miss_d_bus
Forum Members
Forum Members
Posts: 121
Joined: Sun May 01, 2005 4:27 pm
Location: Kent, UK

Re: WYSIWYG Editor Problems

Post by miss_d_bus »

Unfortunately for me that change did not make any difference.

Thanks,
Catherine
aksival

Re: WYSIWYG Editor Problems

Post by aksival »

Once you change the connector don't forget to edit the config files, too.
miss_d_bus
Forum Members
Forum Members
Posts: 121
Joined: Sun May 01, 2005 4:27 pm
Location: Kent, UK

Re: WYSIWYG Editor Problems

Post by miss_d_bus »

I am not sure actually what to edit.

I have edited:

/modules/FCKeditorX/FCKeditor/fckconfig.js and changed ASP to PHP as mentioned but not sure where else this needs to be done.

Could you please let me know?
Thanks
aksival

Re: WYSIWYG Editor Problems

Post by aksival »

There are two files to edit.  The first one is for file browing:

editor/extensions/fckeditor/editor/filemanager/browser/default/connectors/[connector language]/config.ext

The second is for general uploads (not using the file browser):

editor/extensions/fckeditor/editor/filemanager/upload/[language]/config.ext

I think that should help...let me know if you get stuck :)
miss_d_bus
Forum Members
Forum Members
Posts: 121
Joined: Sun May 01, 2005 4:27 pm
Location: Kent, UK

Re: WYSIWYG Editor Problems

Post by miss_d_bus »

I see the files now but i am not sure what should be edited here.  :-[
If you could advise, I'd be grateful.
aksival

Re: WYSIWYG Editor Problems

Post by aksival »

Depending on which language you're using, the syntax will vary.  for PHP, you'll probably only need to modify these variables:

Code: Select all

$Config['Enabled'] = true ;

$Config['UserFilesPath'] = '/userfiles/' ;
(Remember that the UserFilesPath is root relative, but still requires the prefixed slash)

This applies for both config files.  The rest of the options are preferences -- the comments explain them in reasonable detail.
miss_d_bus
Forum Members
Forum Members
Posts: 121
Joined: Sun May 01, 2005 4:27 pm
Location: Kent, UK

Re: WYSIWYG Editor Problems

Post by miss_d_bus »

Unfortunately the problem remains after that editing as if I had not done anything but thank you for the help.

What is confusing is that this same CMS works fine on another system that is far stricter with how PHP works whereas the problems I am encountering is on a server that has safe mode off and similar settings. I would try another WYSIWYG editor but they dont seem to work either.

I hope new version of this CMS will fix whatever is wrong.
aksival

Re: WYSIWYG Editor Problems

Post by aksival »

Why don't you post your config files.  I've ran this editor on many different systems/configs without any issues although, admittedly, it is tricky until you become familiar with the way you set them up.

It would help if you could post the main config file and the two connector config files.
miss_d_bus
Forum Members
Forum Members
Posts: 121
Joined: Sun May 01, 2005 4:27 pm
Location: Kent, UK

Re: WYSIWYG Editor Problems

Post by miss_d_bus »

Thank you for all your help. It does appear to be quite complicated as i am not sure what all the variables do.
Here are the three files.

/module/FCKeditor/FCKeditor/fckconfig.js:

Code: Select all


// Disable the custom Enter Key Handler. This option will be removed in version 2.5.
FCKConfig.DisableEnterKeyHandler = false ;

FCKConfig.CustomConfigurationsPath = '' ;

FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
FCKConfig.ToolbarComboPreviewCSS = '' ;

FCKConfig.DocType = '' ;

FCKConfig.BaseHref = '' ;

FCKConfig.FullPage = false ;

FCKConfig.Debug = false ;
FCKConfig.AllowQueryStringDebug = true ;

FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
FCKConfig.PreloadImages = [ FCKConfig.SkinPath + 'images/toolbar.start.gif', FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif' ] ;

FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;

// FCKConfig.Plugins.Add( 'autogrow' ) ;
FCKConfig.AutoGrowMax = 400 ;

// FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ;	// ASP style server side code <%...%>
// FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ;	// PHP style server side code
// FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ;	// ASP.Net style tags <asp:control>

FCKConfig.AutoDetectLanguage	= true ;
FCKConfig.DefaultLanguage		= 'en' ;
FCKConfig.ContentLangDirection	= 'ltr' ;

FCKConfig.ProcessHTMLEntities	= true ;
FCKConfig.IncludeLatinEntities	= true ;
FCKConfig.IncludeGreekEntities	= true ;

FCKConfig.ProcessNumericEntities = false ;

FCKConfig.AdditionalNumericEntities = ''  ;		// Single Quote: "'"

FCKConfig.FillEmptyBlocks	= true ;

FCKConfig.FormatSource		= true ;
FCKConfig.FormatOutput		= true ;
FCKConfig.FormatIndentator	= '    ' ;

FCKConfig.ForceStrongEm = true ;
FCKConfig.GeckoUseSPAN	= false ;
FCKConfig.StartupFocus	= false ;
FCKConfig.ForcePasteAsPlainText	= false ;
FCKConfig.AutoDetectPasteFromWord = true ;	// IE only.
FCKConfig.ForceSimpleAmpersand	= false ;
FCKConfig.TabSpaces		= 0 ;
FCKConfig.ShowBorders	= true ;
FCKConfig.SourcePopup	= false ;
FCKConfig.ToolbarStartExpanded	= true ;
FCKConfig.ToolbarCanCollapse	= true ;
FCKConfig.IgnoreEmptyParagraphValue = true ;
FCKConfig.PreserveSessionOnFileBrowser = false ;
FCKConfig.FloatingPanelsZIndex = 10000 ;

FCKConfig.TemplateReplaceAll = true ;
FCKConfig.TemplateReplaceCheckbox = true ;

FCKConfig.ToolbarLocation = 'In' ;

FCKConfig.ToolbarSets["Default"] = [
	['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
	['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
	['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
	['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
	'/',
	['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
	['OrderedList','UnorderedList','-','Outdent','Indent'],
	['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
	['Link','Unlink','Anchor'],
	['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
	'/',
	['Style','FontFormat','FontName','FontSize'],
	['TextColor','BGColor'],
	['FitWindow','-','About']
] ;

FCKConfig.ToolbarSets["Basic"] = [
	['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;

FCKConfig.EnterMode = 'p' ;			// p | div | br
FCKConfig.ShiftEnterMode = 'br' ;	// p | div | br

FCKConfig.Keystrokes = [
	[ CTRL + 65 /*A*/, true ],
	[ CTRL + 67 /*C*/, true ],
	[ CTRL + 70 /*F*/, true ],
	[ CTRL + 83 /*S*/, true ],
	[ CTRL + 88 /*X*/, true ],
	[ CTRL + 86 /*V*/, 'Paste' ],
	[ SHIFT + 45 /*INS*/, 'Paste' ],
	[ CTRL + 90 /*Z*/, 'Undo' ],
	[ CTRL + 89 /*Y*/, 'Redo' ],
	[ CTRL + SHIFT + 90 /*Z*/, 'Redo' ],
	[ CTRL + 76 /*L*/, 'Link' ],
	[ CTRL + 66 /*B*/, 'Bold' ],
	[ CTRL + 73 /*I*/, 'Italic' ],
	[ CTRL + 85 /*U*/, 'Underline' ],
	[ CTRL + SHIFT + 83 /*S*/, 'Save' ],
	[ CTRL + ALT + 13 /*ENTER*/, 'FitWindow' ],
	[ CTRL + 9 /*TAB*/, 'Source' ]
] ;

FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form'] ;

FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ;

FCKConfig.FontNames		= 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
FCKConfig.FontSizes		= '1/xx-small;2/x-small;3/small;4/medium;5/large;6/x-large;7/xx-large' ;
FCKConfig.FontFormats	= 'p;div;pre;address;h1;h2;h3;h4;h5;h6' ;

FCKConfig.StylesXmlPath		= FCKConfig.EditorPath + 'fckstyles.xml' ;
FCKConfig.TemplatesXmlPath	= FCKConfig.EditorPath + 'fcktemplates.xml' ;

FCKConfig.SpellChecker			= 'ieSpell' ;	// 'ieSpell' | 'SpellerPages'
FCKConfig.IeSpellDownloadUrl	= 'http://www.iespell.com/download.php' ;
FCKConfig.SpellerPagesServerScript = 'server-scripts/spellchecker.php' ;	// Available extension: .php .cfm .pl

FCKConfig.MaxUndoLevels = 15 ;

FCKConfig.DisableObjectResizing = false ;
FCKConfig.DisableFFTableHandles = true ;

FCKConfig.LinkDlgHideTarget		= false ;
FCKConfig.LinkDlgHideAdvanced	= false ;

FCKConfig.ImageDlgHideLink		= false ;
FCKConfig.ImageDlgHideAdvanced	= false ;

FCKConfig.FlashDlgHideAdvanced	= false ;

FCKConfig.ProtectedTags = '' ;

// This will be applied to the body element of the editor
FCKConfig.BodyId = '' ;
FCKConfig.BodyClass = '' ;

// The option switches between trying to keep the html structure or do the changes so the content looks like it was in Word
FCKConfig.CleanWordKeepsStructure = false ;

// The following value defines which File Browser connector and Quick Upload
// "uploader" to use. It is valid for the default implementaion and it is here
// just to make this configuration file cleaner.
// It is not possible to change this value using an external file or even
// inline when creating the editor instance. In that cases you must set the
// values of LinkBrowserURL, ImageBrowserURL and so on.
// Custom implementations should just ignore it.
var _FileBrowserLanguage	= 'php' ;	// asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage	= 'php' ;	// asp | aspx | cfm | lasso | php

// Don't care about the following line. It just calculates the correct connector
// extension to use for the default File Browser (Perl uses "cgi").
var _FileBrowserExtension = _FileBrowserLanguage == 'perl' ? 'cgi' : _FileBrowserLanguage ;

FCKConfig.LinkBrowser = true ;
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
FCKConfig.LinkBrowserWindowWidth	= FCKConfig.ScreenWidth * 0.7 ;		// 70%
FCKConfig.LinkBrowserWindowHeight	= FCKConfig.ScreenHeight * 0.7 ;	// 70%

FCKConfig.ImageBrowser = true ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
FCKConfig.ImageBrowserWindowWidth  = FCKConfig.ScreenWidth * 0.7 ;	// 70% ;
FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ;	// 70% ;

FCKConfig.FlashBrowser = true ;
FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
FCKConfig.FlashBrowserWindowWidth  = FCKConfig.ScreenWidth * 0.7 ;	//70% ;
FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ;	//70% ;

FCKConfig.LinkUpload = true ;
FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage ;
FCKConfig.LinkUploadAllowedExtensions	= "" ;			// empty for all
FCKConfig.LinkUploadDeniedExtensions	= ".(html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi|htaccess|asis)$" ;	// empty for no one

FCKConfig.ImageUpload = true ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Image' ;
FCKConfig.ImageUploadAllowedExtensions	= ".(jpg|gif|jpeg|png|bmp)$" ;		// empty for all
FCKConfig.ImageUploadDeniedExtensions	= "" ;							// empty for no one

FCKConfig.FlashUpload = true ;
FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Flash' ;
FCKConfig.FlashUploadAllowedExtensions	= ".(swf|fla)$" ;		// empty for all
FCKConfig.FlashUploadDeniedExtensions	= "" ;					// empty for no one

FCKConfig.SmileyPath	= FCKConfig.BasePath + 'images/smiley/msn/' ;
FCKConfig.SmileyImages	= ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ;
FCKConfig.SmileyColumns = 8 ;
FCKConfig.SmileyWindowWidth		= 320 ;
FCKConfig.SmileyWindowHeight	= 240 ;
/modules/FCKeditorX/FCKeditor/editor/filemanager/upload/php/config.php:

Code: Select all

<?php
global $Config ;

// SECURITY: You must explicitelly enable this "uploader".
$Config['Enabled'] = true ;

// Set if the file type must be considere in the target path.
// Ex: /userfiles/image/ or /userfiles/file/
$Config['UseFileType'] = false ;

// Path to uploaded files relative to the document root.
// $Config['UserFilesPath'] = $config['uploads_url'].'/' ;
$Config['UserFilesPath'] = '/userfiles/' ;

// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = $config['uploads_path'].'/' ;

// Due to security issues with Apache modules, it is reccomended to leave the
// following setting enabled.
$Config['ForceSingleExtension'] = true ;

$Config['AllowedExtensions']['File']	= array() ;
$Config['DeniedExtensions']['File']		= array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','htaccess','asis') ;

$Config['AllowedExtensions']['Image']	= array('jpg','gif','jpeg','png') ;
$Config['DeniedExtensions']['Image']	= array() ;

$Config['AllowedExtensions']['Flash']	= array('swf','fla') ;
$Config['DeniedExtensions']['Flash']	= array() ;

?>

/modules/FCKeditorX/FCKeditor/editor/filemanager/browser/default/connectors/php/config.php:

Code: Select all

<?php
global $Config ;

// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
$Config['Enabled'] = true ;


// Path to user files relative to the document root.
// $Config['UserFilesPath'] = $config['uploads_url'] ;

$Config['UserFilesPath'] = '/userfiles/' ;

// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = $config['uploads_path'].'/' ;

// Due to security issues with Apache modules, it is reccomended to leave the
// following setting enabled.
$Config['ForceSingleExtension'] = true ;

$Config['AllowedExtensions']['File']	= array() ;
$Config['DeniedExtensions']['File']		= array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','htaccess','asis') ;

$Config['AllowedExtensions']['Image']	= array('jpg','gif','jpeg','png') ;
$Config['DeniedExtensions']['Image']	= array() ;

$Config['AllowedExtensions']['Flash']	= array('swf','fla') ;
$Config['DeniedExtensions']['Flash']	= array() ;

$Config['AllowedExtensions']['Media']	= array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') ;
$Config['DeniedExtensions']['Media']	= array() ;

?>
Thank you!
aksival

Re: WYSIWYG Editor Problems

Post by aksival »

The configs look fine.  Remember it is vital that the paths are set correctly and make sure those directories are accessible to the Apache (IIS?) user (if you're using a remote web host then this shouldn't be an issue).

It might also help to see how you're instantiating the editor.  Make sure your base path is relative (no preceding slashes), this has caused problems on some systems for me:

Code: Select all

$sBasePath = "extensions/fckeditor/";
include($sBasePath . "fckeditor.php");
$oFCKeditor = new FCKeditor("editor1");
$oFCKeditor->BasePath = $sBasePath;
$oFCKeditor->Value = "Sample content";
$oFCKeditor->Height = 400;
$oFCKeditor->Create();
One other thing comes to mind...although FCKeditor is supposed to automatically create the userfiles directory, if it doesn't already exist you might try putting it there.  There could be some kind of permissions issue going on.

This last thing might sound silly, but make sure you upload all of the correct files to the remote server (assuming you are working on a remote server).  This includes the two files buried in the /filemanager/.../... directories (the connector configs).

Like I said, it's a bit confusing at first and I went through similar frustrations when I started implementing the FCKeditor into my projects, but out of all the one's I've tested and used (and I've tested a LOT of them), this one is by far the best for configuration and code output.  The more you play with the configs over and over again the easier it will be the next time you have to do it.

It might even be helpful to start with a fresh install of the editor...weird but it's worked for me before.

Let me know how it works :)
Locked

Return to “CMSMS Core”