Geeklog's Advanced Editor

An advanced editor option is now available as part of the Geeklog 1.4 release. The integration of the FCKeditor which is one of the most popular and well supported OpenSource (LGPL Licensed) HTML editors brings to the web many of the powerful functionalities of desktop editors like MS Word.

A summary of the integration features:

Advanced Editor is enabled via a setting in the main site config.php

Enabled for Story Editor, contribute story or comment forms, and Staticpage Editor

The image/file browser will upload all the images/files to directories by default that are under your public_html ($_CONF['path_html']) directory. A new directory called library will have 4 sub folders (directories) that store the different resource types (images,files,assorted media). You can then create subfolders using the image browser to organize your library. The path to the main library directory can be changed if desired.

Notes for anyone not using the supplied professional theme - new templates are required to enable the Editor

In addition to enabling the 'advanced_editor' it requires new template files to also exist for your current theme

The Story Editor is an Admin only (user with story.edit access) and the template for the Story Editor is under [theme]/admin/story. There needs to be a storyeditor_advanced.thtml file otherwise the default storyeditor.thtml file will be used and the FCKeditor will not appear.

The Story Comment feature uses: [theme]/comment/commentform_advanced.thtml

The Staticpage Editor needs to see $_CONF['path']/plugins/staticpages/templates/admin/editor_advanced.thtml

Each of these new template files are the same filename as the original + the _advanced' portion of the name.

Directory Permissions:

Make sure the image library directories have write permission or you will get a Quota Error message when you attempt to upload a new image or file.

The permissions need to be similar as other directories where you can upload images like a user photo (images/userphotos). Verify that feature works under your account profile and use the same permissions

Customizing the Editor Toolbars used

There are several toolbar configurations defined which can be changed to add/remove any of the possible FCKeditor features or to re-arrange the toolbar icons.

The FCKeditor config file which defines the Editor Options is under public_html/fckeditor and is called fckconfig.js

Details on how to customize the toolbar - refer to the documentation on the FCKeditor site here

The default Editor config has an icon to launch the HTML editor in a new window giving you more editing area. When this is used, a second toolbar configuration is used which has more toolbar options. This toolbar is called 'NewToolbarClose'

There are several other toolbar configurations shown in the fckconfg.js file as examples.

The toolbar used for contributing comments is also 'editor-toolbar1' but this can be changed to a different toolbar in public_html/javascript/submitcomment_fckeditor.js

You may also note that you can change the starting height of the editors in this config area

Other Frequently asked questions:

How do I launch the Edtitor in a new window

How do I insert a line break instead of a new paragraph:> Use Shift-Enter instead of just Enter

Are there shortcuts for some of the formatting options> Yes, use Cntrl-B for Bold, Ctrl-I for Italic, Ctrl-U for underline. Repeat to turn off> Use your mouse RightClick to show a context-sensitive menu. Specially if editing tables

Can I view the HTML Source and edit it.> Yes, the Source toolbar option is for this. Just make sure you return to non-source mode before saving or the changes will be lost.

How do I upload files> Using the Image Browser "mountain like icon on the toolbar", use the "link" subtab of the first pop-up instead of the "Image Info" tab. You can then browse and upload new 'file' type or other resource types. You would also use the "Image Info" to use an icon for the image to be displayed as the link to the file/resource you have just uploaded.

Example: < click meNote: Set the image border property to 0 to not show the image border

Right now, I feel I have a better change of building a nuclear bomb than finding out how to upload a file in this editor. Is this a test? Are you supposed to be a nobel prize winner to be able to upload a file?

So fine, I've pressed full screen. Fine, I've pressed "link". But now what? The "Browse" button doesn't do a thing! Nada! Nothing!
I should mention it insists on being in Hebrew, although I've set my browser on "en-us".

Now let's supposed it worked. Is this even a browser or an upload button? If the former, how am I supposed to upload through a browse button?

The same of course goes to the image too. But nevertheless, shouldn't it select, say, pdf.gif automatically...?

Hey, LWC, I know you are almost as smart as a noble prize winner, but I am having no problem with uploading files or images. So you might not be speaking on behalf of everyone.

Did you set the images/library/* folders to writeable? Have you tried with different browsers?

With IE you have to allow popup for the upload to work.

After pressing the "Browse Server" button, a new window pops up, which shows the current files in the server, and at the bottom there are links and buttons for you to create new folders, browse your computer, and, yes, there is an upload button for you to upload.

That part is actually commented out. But nevertheless, do you remember I can't even click the browse button?

I've done a lot of tests and came up with this:

demo.geeklog.net - out of 4 supposedly identical XP systems (in all of which I've enabled popups for demo.geeklog.net - I usually expect a prompt) only in 1 could I press the browse button and a window has actually opened (although it didn't let me upload - invalid XML whatever - I guess you blocked it).

To make sure they're identical in their IE settings, I've even put demo.geeklog.net in the Trusted sites...it made no difference.

My own site - out of the same 4 systems, none of them opened up a window when I clicked the browse button!

I've tried chmodding 777 to images/, images/library/, everything inside the latter - still nothing (although I don't think 777 has anything to do with actually opening up the window).

Samstone, I now know how you felt when you couldn't work the multilingual hack!

The FCKeditor demo site is most likey not using the mcpuk Image Browser. When I first started the integration of the FCKeditor, the default image browser had major issues and I only had success with integrating the mcpuk version. This was about 6 months ago and since then I understand the integrated version has improved. I was not about to then back track and remove/replace and re-test as we were well ahead in the Release Plan for 1.4 and was not seeing any issues.

I don't know if that's why your seeing a difference with the FCKeditor demo site vs our GL Demo site or if both versions may have an issue with using a proxy.

The tone of your posts sure don't encourage me to want to respond and help ;)

Anyway it would appear most users are not having an issue as I have not seen many questions on this and either it's not being used or there are few questions.

That aside, I have installed and tested the integrated FCKEditor on several clean GL 1.4 installations including hosted environments. I just tested the demo site and had no issues with the 'browse button' appearing but was not able to upload a file/image because of directory permissions. I've updated the perms on the demo site now and was able to complete without issue - editing a story and uploading a file which was then referenced via an icon like my example article shows above.

You may want to try enabling the extra debugging for the Image Library Plugin PHP Connector. Edit the public_html\fckeditor\editor\filemanager\browser\mcpuk\connectors\php\config.php file. Around Line 190 is a section for the Debugging Options. Set all the Debug options to true. Once you get an error, look a the debug trace file under your GL logs directory.

After loading the form.[error] Directory index forbidden by rule: /var/www/html/fckeditor/editor/[error] File does not exist: /var/www/html/403.shtml

After going full screen:[error] Directory index forbidden by rule: /var/www/html/fckeditor/editor/dialog/[error] File does not exist: /var/www/html/403.shtml

After clicking "browse":[error] PHP Warning: file(/var/www/geeklog/logs/fck.dbg) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in /var/www/html/fckeditor/editor/filemanager/browser/mcpuk/connectors/php/connector.php on line 30[error] PHP Warning: implode() [<a href='function.implode'>function.implode</a>]: Bad arguments. in /var/www/html/fckeditor/editor/filemanager/browser/mcpuk/connectors/php/connector.php on line 30

Do you see those borbidden errors? When my proxy isn't bypassed, it also reports those errors, so maybe that's the problem. But why does it happen when the proxy isn't bypassed? And why does it semi-happen when it is bypassed and everything is seemingly ok?

fck.dbg (again, when the proxy is bypassed) takes up 20K so I won't paste it here.

Now the issue appears to be isolated. I don't do any development with a proxy nor have any clients using such as setup. Unless anyone else that can shed more light on the proxy issue,I'd suggest you post this on the FCKeditor support forums.

I'd also like to ask if images/library is a shared zone. That is, I see that even anonymous users (if I don't take away their toolbar) or at least every registered user can upload freely and worse still, edit and delete every else's files and folders in there.

While maybe good for a community site, I plan to update some companies' sites into v1.4. What is the "official" recommendations for such sites? I guess only image/link is really risky. Too bad though, because I'd have to keep upload PDF files manually. I hoped v1.4 would solve this.

You showed us how to replace the comments, story (non-admin) and staticpages' toolbars, but replace to what? And is story the only one that is divided to non admin/admin?

You probally want to change the toolbar used in the comment and anonymous contribute forms then to not have the "launch new large editor window" icon/feature.

As to change it to what - well thats's up to you. I provide several examples and the toolbar definitions should not be that hard to understand. I've given a link to the FCKeditor site and the helpfile on the toolbar customizations in the article. That link is here

Alright, I've updated the second site from PHP v5.0.3 to v5.0.5 and immediately the files became visible! Any idea why is that?

And I still like to know how come everyone can mess out with everyone else's files? I guess only story admins should really get the "image" icon in the toolbar and hopefully they won't delete each other's files...

Are story admins the ones who also get bodytext (that's the difference in FCKeditor between regular story writers and admins)?

An advanced editor option is available as part of the Geeklog 1.4 release with the integration of the FCKeditor. This is a one of the most popular and supported OpenSource (LGPL Licensed) HTML editors brings to the web many of the powerful functionalities of desktop editors like MS Word. It's lightweight and doesn't require any kind of installation on the client computer brings to the web many of the powerful functionalities of desktop editors like MS Word.

Should read:

FCKeditor is an advanced editor option that has been integrated into Geeklog. The FCKeditor is available as part of the Geeklog 1.4 release. This is a one of the most popular and supported OpenSource (LGPL Licensed) HTML editors on the web. The FCKeditor offers many of the powerful functionalities found in desktop editors like MS Word. It's lightweight and doesn't require any kind of installation on the client computer.

I also get like 20 syntax errors in my FireFox Javascript console when enabling this option.

I was just posting up a new article for my GPL site and I noticed a couple of things:

- when I copied and pasted some HTML it retained font tags, yet in the default GL configuration we have no way to configure fonts. I had to go in and manually strip the offending tags out. Shouldn't the editor be configured to strip these by default? font is an allowed tag in my confuguration - is that likely to be the cause?

- I'm still getting "read more (1 word)" on all of my stories despite having nothing in the body. Is this being looked into?

- I tried using the indent feature that's included in the default configuration but it didn't render on display. What tags do I need enabled to get this to work? I'll have a look at the html it's trying to save and see if I can work this out.

As ever - big applause to the GL team for a fine product!

(I'm running 1.40 and plan to get the service pack installed in the next day or two).

"- I'm still getting "read more (1 word)" on all of my stories despite having nothing in the body."

I suspect this is caused by some default html tags that are preloded in FCK. If you, before saving a story, cklick on source in the main body text you should see the default tags. Try removing them before saving

Anyway, what does it have to do with this problem? Not only did Dirk not claim to have upgraded FCKEditor but he actually mentioned he didn't upgrade it...

I would have said to upgrade it yourself like Dirk suggested, but I'm not sure that would solve this problem as this is a Geeklog problem. All I can say is that it sometimes happens and sometimes doesn't, so if only someone told us what triggers it, it would have been nice.

Relax, I just pointed out that your problem had nothing to do with SR3 (which full name I stressed so you'd release each Geeklog version has SRXs...) as SR3 didn't touch the subject. In SR3 Dirk suggested to upgrade FCKEditor.

And it's funny you find it logical that others would look for it for hours and hours. I mean, at least say "I don't find it logical when I know others probably know exactly what's wrong".

I fully appreciate SR3 is a security release. However I mentioned it simply to state clearly that I was running the latest version. I've been running a GL site for well over three years so I know how the patches work - but that's not gonna stop me hoping optimistically that wee fixes might not find their way in. The updated files didn't suggest any changes in the suspected areas so naturally I came here to ask around and see if it was on anyone's radar.

I've seen people talking about updating the editor ever since it was released, but having dug around in the code in the past it struck me as being reasonably heavily modified by Blaine so I was naturally reluctant to delve into that myself. Plus I see that 1.4.1 isn't all that far away...

Re hours and hours, I said it was logical to ASK if the problem had been fixed first, before I went looking at code, IN CASE someone else has already nutted it out. Frankly to not ask before diving in would be daft - well unless you've got oodles of free time and some of us don't.

Seems to me that Dirk summed things up nicely. He clearly stated the problem lay in the FCKEditor, that he had a workaround in GL, and that an upcoming release of GL with the newer editor should fix it, and if not the fallback is there just in case. Short, succint, and brimming with nuggets of information. Very nice and exactly the feedback I was hoping for.

If it reads like I'm harping on about this, well from where I'm sitting this is something that's plastered across my site and isn't working right. It's certainly one of the most visible bugs I've seen in my three years plus running GL so I was hoping it wasn't just me getting the problem (another reason to ask again). And if no-one was aware of it I was fully prepared to put some time into it to try to work out just what was going on. The fact that Dirk came straight back with a classy response just reaffirms just how good he and his team is and how worthy they are of our applause and support.

Truth be told, the only 100% Geeklog related thing he did (the custom Javascripts aside because they're not part of FCKEditor) was modifying FCKEditor's config.php to catch Geeklog's config.php's $_CONF_FCK['imagelibrary'], which kind of wastes resources (see my post in that topic) but I admit I didn't find a better way.

I say smart enough because this is exactly the reason it's relatively easy to upgrade (full instructions by samstone and by myself are provided in the aforementioned topic).

Any of you experiancing problem with FCKeditor should consider upgrading it to 2.2 from the FCKeditor site. It works great for me, with the exception that they no longer use the previous file manager that shows image thumbnails, but only file names. Good enough for me. The main benefit is that you get a much stabler program.

I had missed {advanced_editor} in header.thtml. That rectified the menu bars for the fckedit intro and body text sections, but the menu bar on top appears messed likely due to my CSS, it shows text on mouseover but not normally.

I have just upgraded to GL1.4.1 from GL1.4.0sr5 where FCK worked and now I am getting the sam error you are that toolbar-1 doesn't exist? I have recopied all the files over and still have the same error. The toolbar works fine when I am not logged in and click contribute. If I log in as admin or a user I get the error in stories, comment and static pages.