Page 1 of 3

Update FCKeditor from v1.5 -> v2 RC1

Posted: Sat 4. Dec 2004, 22:39
by frold
The new FCKeditor have many improvements since 1.5, see them here: http://www.fckeditor.net/whatsnew/default.html
Internet Explorer 5.5+ and Gecko browser (Mozilla / Firefox / Netscape) compatibility
XHTML 1.0 support
Font formatting: type, size, color, style, bold, italic, etc
Text formatting: alignment, indentation, bullets list, etc
Cut, Paste and Past as Plain Text, Undo and Redo
Paste from Word cleanup with auto detection
Link creation
Anchors support (version 1.x)
Image insertion, with upload and server browsing support
Table creation and editing (add, delete rows, etc)
Table cells editing (size, colors, etc) (version 1.x)
Form fields (version 1.x)
Right click context menus support
Complete toolbar customization
Skins support.
Spell checker (version 1.x)
CSS support for a better integration in your web site
Multi-language support with automatic user language detection. Including Right to Left reading.
Lightweight and fast
Automatic browser detection and customization
Integration with ASP, ASP.NET, Java, ColdFusion, PHP, Javascript and IE Behaviours (version 1.x)
Image and file links upload and server repository browser.
For web developer it is easy to install and customize
For web users it's simply easy to use!
Try out the demo here: http://www.fckeditor.net/demo/default.html

I have now made FCKeditor work with phpwcms...

Download and upload the file: http://www.studmed.dk/files/fckeditorv2.zip

The file includes:
include/inc_ext/FCKeditorv2
include/inc_lib/fckeditor.editor.inc.php (replace the old one)

Remember to backup files... I have only tested it local....

Open
inc_tmpl/content/cnt1.inc.php

Find:

Code: Select all

				//load FCKeditor
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $content["text"] ;
				$oFCKeditor->CreateFCKeditor( 'ctext', '100%', '500' ) ;
				break;
Replace with:

Code: Select all

				//load FCKeditor
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor(ctext) ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $content["text"] ;
				$oFCKeditor->Create() ;
				break;
Open:
inc_tmpl/content/cnt14.inc.php

Find:

Code: Select all

				//load FCKeditor
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $content["html"] ;
				$oFCKeditor->CreateFCKeditor( 'chtml', '100%', '600' ) ;
				break;
Replace with:

Code: Select all

				//load FCKeditor			
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor(chtml) ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $content["html"] ;
				$oFCKeditor->Create() ;
				break;
Open:
inc_tmpl/article.editsummary.tmpl.php

Find:

Code: Select all

				//load FCKeditor
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $article["article_summary"] ;
				$oFCKeditor->CreateFCKeditor( 'article_summary', '100%', '350' ) ;
				break;
Replace with:

Code: Select all

				//load FCKeditor
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor(article_summary) ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $article["article_summary"] ;
				$oFCKeditor->Create() ;
				break;
Open
inc_tmpl/article.new.tmpl.php

Find:

Code: Select all

				//load FCKeditor
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $article_summary ;
				$oFCKeditor->CreateFCKeditor( 'article_summary', '100%', '350' ) ;
				break;
Replace with:

Code: Select all

				//load FCKeditor
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor(article_summary) ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $article_summary ;
				$oFCKeditor->Create() ;
				break;
Open:
inc_tmpl/message.newsletter.tmpl.php

Find:

Code: Select all

				//load FCKeditor
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $newsletter["newsletter_vars"]['html'] ;
				$oFCKeditor->CreateFCKeditor( 'newsletter_html', '100%', '300' ) ;
				break;
Replace with:

Code: Select all

				//load FCKeditor
		case 2:	include(PHPWCMS_ROOT."/include/inc_lib/fckeditor.editor.inc.php") ;
				$oFCKeditor = new FCKeditor(newsletter_html) ;
				$oFCKeditor->ToolbarSet = 'phpwcms' ;
				$oFCKeditor->Value = $newsletter["newsletter_vars"]['html'] ;
				$oFCKeditor->Create() ;
				break;
To use the style function inside the editor you need to place this in your template under "html head"

Code: Select all

<link href="include/inc_ext/FCKeditorv2/editor/css/fck_editorarea.css" rel="stylesheet" type="text/css">

Posted: Mon 6. Dec 2004, 13:38
by frold
It Seems like it doesn´t work in mozilla browsers even though FCKeditor version 2 RC1 support mozilla browsers, so I guess it is phpwcms that blocks it.

I let you know when I have found a solution - if you find it first, then please share it :D

Posted: Mon 6. Dec 2004, 17:03
by bachi
i have the same problem.
the new FCKeditor doesn't work in firefox

Posted: Mon 6. Dec 2004, 18:40
by frold
bachi wrote:i have the same problem.
the new FCKeditor doesn't work in firefox
well a friend of mine using mozilla or was it firefox could use the demo: http://www.fckeditor.net/demo/default.html but not this mod....

Modification needed for Mozilla-based browsers

Posted: Thu 9. Dec 2004, 18:22
by visioneer
Hey all I just implemented this update. I've had problems with Mozilla/Firefox not being able to use the WYSIWYG editors. To get FCKeditor to work you need to change the login.php file.

Find:

Code: Select all

//WYSIWYG EDITOR:
//0 = no wysiwyg editor (default)
//1 = HTMLAREA (compatible with IE5.5+ and Mozilla 1.3+ based webbrowsers)
$_SESSION["wysiwyg_editor"] = 0;
Replace Inline:

Code: Select all

//WYSIWYG EDITOR:
//0 = no wysiwyg editor (default)
//1 = HTMLAREA (compatible with IE5.5+ and Mozilla 1.3+ based webbrowsers)
$_SESSION["wysiwyg_editor"] = 2; // This forces use of FCKeditor
Hope this helps you guys out. I've got it working in Firefox both Win/Mac. The only problem I have right now is that the FCKeditor toolbar is getting cut off. Any ideas? It seems the WYSIWYG area needs to be made wider. Any suggestions on that?

Posted: Thu 9. Dec 2004, 18:29
by frold
thanks!!

But it shouldn´t be 3 instead of 2?
case 3: if($c->browser_is("ie5.5+")) $_SESSION["wysiwyg_editor"] = 4;
if(!$_SESSION["wysiwyg_editor"]) {
if($c->browser_is("mz1.3+") || $c->browser_is("ns7+")) $_SESSION["wysiwyg_editor"] = 1;
}

Re: Modification needed for Mozilla-based browsers

Posted: Thu 9. Dec 2004, 18:41
by visioneer
visioneer wrote:The only problem I have right now is that the FCKeditor toolbar is getting cut off. Any ideas? It seems the WYSIWYG area needs to be made wider. Any suggestions on that?
Well I figured out something that at least works. Edit the fckeditor.editor.inc.php file, and make the following change.

Find:

Code: Select all

	function FCKeditor( $instanceName )
	{
		$this->InstanceName	= $instanceName ;
		$this->BasePath		= "".$phpwcms["root"]."/include/inc_ext/FCKeditorv2/" ;
		$this->Width		= '100%' ;
		$this->Height		= '500' ;
		$this->ToolbarSet	= 'Default' ;
		$this->Value = $content["text"] ;

		$this->Config		= array() ;
	}
Replace Inline:

Code: Select all

		$this->Width		= '540' ; // Found the to be an acceptable width inside phpwcms

Posted: Thu 9. Dec 2004, 18:44
by visioneer
frold wrote:thanks!!

But it shouldn´t be 3 instead of 2?
case 3: if($c->browser_is("ie5.5+")) $_SESSION["wysiwyg_editor"] = 4;
if(!$_SESSION["wysiwyg_editor"]) {
if($c->browser_is("mz1.3+") || $c->browser_is("ns7+")) $_SESSION["wysiwyg_editor"] = 1;
}
If you set it to 3 this is going to use the Browser-based settings. FCKeditor never shows using this option. You'll either get SPAW on Win/IE or HtmlArea on other browsers/platforms. At least this is what I've experienced. If I'm not clear on something please let me know.

Posted: Thu 9. Dec 2004, 19:04
by frold
Im glad it work... I do not myself have mozilla yet,...


Hope you will enjoy the FCKeditor 2.0 RC1 So much more powerfull then 1.5

Posted: Thu 9. Dec 2004, 20:13
by bachi
YEAH, it works fine 8)
Thanks

Posted: Thu 9. Dec 2004, 20:58
by kerthi
Works Great! Thanx!

greez kerthi

Posted: Fri 10. Dec 2004, 09:18
by sustia
Hi frold, this works very fine, but there's a little probleme with the window of the editor.
The editor don't let me to see the complete window, as indicated by the arrow.


Image

Posted: Fri 10. Dec 2004, 09:28
by frold
Well that´s the problem with a editor like that.

The problem is in some way the translation in tha lang file.

It not easy to take in mind all kind of translations, so if I was you I would edit my Italian translation eg.

Find:

Code: Select all

FontSize		: "Dimensione",
Replace with:

Code: Select all

FontSize		: "",
You could eg. do the same with Stile, Formatio, Font....

Sry thats the only way to do it. Otherwise the editor will be on 4 lines instead of 3.

Else you fit the toolbar layout in: FCKeditorv2/fckconfig.js

Code: Select all

FCKConfig.ToolbarSets["phpwcms"] = [
	['Source','Save','NewPage','Preview','-','Cut','Copy','Paste','PasteText','PasteWord','-','Print','Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat','-','SpecialChar','Smiley','About'],
      ['Bold','Italic','Underline','StrikeThrough','-','OrderedList','UnorderedList','-','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','Link','Unlink','-','Image','Table','Rule'],
	['TextColor','BGColor'],
      ['Style','FontFormat','FontName','FontSize']

Posted: Fri 10. Dec 2004, 09:47
by sustia
Ok, thanks, I will try to do this :)

Problem with Insert Image - Browse Server

Posted: Fri 10. Dec 2004, 11:04
by pico
have the Problem that the 'Browse Server' Function in insert Image will not work - think the path to the Images are wrong but I can't find where it is set.

When I try to upload a Image something happens - but there will be still no Image in the Browser

any help ?