Firefox PHP

WYSIWYG Editor for Phorum (edit: CKEditor spamvertisement)

Posted by klgordon 
Re: WYSIWYG Editor for Phorum (edit: CKEditor spamvertisement)
October 15, 2010 05:17AM
This fixed the multiple <br> issue, but again has the disadvantage that - if I am "editing" an already existing post with BBCode in it for the fist time (prior to using 'quote' etc ) then, this code will not run (i.e. BBCode will not get converted to html) and again the whole text along with bbcode will become quashed together (i.e. all line and para breaks lost; and there won't be any way to retrieve the earlier formatting) :(
So may be the point it - when I "Edit" for the first time the already BBCode existing message too this module code should run.

Note: If someone who was already using BBCode supported forum for years wants to move to WYSIWYG editor like the CK Editor, a module like this one would be a must for him, so that both the old data and new data are kept well formatted and displayed correctly. Thus certainly this module is not only going to benefit me, but many others as well for sure.

Thanks and regards,
Sreenadh
Re: WYSIWYG Editor for Phorum (edit: CKEditor spamvertisement)
October 15, 2010 05:33AM
Yes, moving from one editor type to the other is not trivial (moving back to bbcode when coming from html would be even worse than the route that you describe).

What would you do?

I would in such case write a script that would convert all messages in the database to the required format, right before releasing the new editor. That route is fully fail safe. Trying to steer things from the module on-the-fly could be error prone.

Another good reason for doing the conversion on all messages, would be a scenario where one would fully deprecate a formatting module like BBcode. When doing that, you need to convert all BBcode tags, before it is possible to switch off that module.

This route also makes it possible to convert back cleanly when necessary. If things would be converted on-the-fly, you would end up with a mix of formatted and unformatted messages. Writing a script that would convert all messages back to BBcode in such scenario, would give a coder a serious head ache. When doing a mass conversion, you know that all messages can be treated the same way when doing another conversion.

Can it be done in the module?

"Edit for the first time" is not the thing here. It is "Edit for the first time on a message that was written using the non-WYSIWYG editor". The module could be extended to do things like keeping a flag in the message meta data if the message was already HTML formatted or not. In such case, editing an old message, for which the flag is not set, could trigger the HTML formatting.

Since I have plenty of other Phorum coding to do, I leave this or the mass message formatter as an excercise to the/a reader.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: WYSIWYG Editor for Phorum (edit: CKEditor spamvertisement)
October 15, 2010 06:02AM
Hi Maurice Makaay,
I appreciate this conversation and agree with you. For me this is not a major issue since our forum is just in the beginning stages and there is only a few previous messages, and also because for the existing messages since I know this issue I can avoid 'editing them'.
Quote

I would in such case write a script that would convert all messages in the database to the required format, right before releasing the new editor. That route is fully fail safe. Trying to steer things from the module on-the-fly could be error prone.
Yes, this is a right statement. Usually there is no need to use two editors (BBCode and WYSIWYG) together. One of them is enough. If it is BBCode editor it is good that everything is in BBCode and if it is WYSWYG editor it is good that everything is in html. Editor switching should be a major decision and running a script for the whole database to convert the data (to BBCode or to HTMlL) should be a connected task. I agree with you on this.

Note: But I think it is already time for -
1) Thinking of incorporating a third party WYSWYG editor (whether it CK Editor or TinyMCE or something else) along with Forum distribution; and also
2) To clearly mention in admin control panel somewhere (possibly alongside the modules) that which modules conflicts with which other or that the functionality of which overlaps with which other.
3) To provide a ACL module so that some of the selected admin functionality can be ascribed to forum moderators to be accessed (possibly) from control panel.
4) Providing a better archive search feature such as the History grid provided by yahoo groups where you can directly jump to the messages of a particular year or month etc.

Even though integrating a mailing list could be another suggestion I may present, but the above could be of more priority.

These are all just suggestions/inputs from a user's perspective.

Thanks for the efforts taken,
Sreenadh



Edited 1 time(s). Last edit at 10/15/2010 06:03AM by Sreenadh OG.
Re: WYSIWYG Editor for Phorum (edit: CKEditor spamvertisement)
October 15, 2010 06:15AM
Every Phorum admin in the world has his own ideas about what really should go in core, because it's so damn important. You are not an exception in that line. But we try to keep the Phorum core clean as a basic functional forum system. Bells and whistles are up to modules.

1) We are not including a third party WYSIWYG editor in Phorum. Such integration should always be a module.(and I don't see why a good module implementation would not work for WYSIWYG, it's just that nobody picked up the job of making it as such till now.)

2) We already have sanity checks in place for doing checks, which can also be used by modules to warn about incompatibilities. The task is not that generic, that you can easily build a clear interface around it. IMO, the place where the user should be warned about incompatbilities, is in the README or the description of the module.

3) Feel free to write the module for that. It is perfectly possible to implement that, but apparently no developer felt the need to implement it. What I would use, are dedicated modules that provide some admin functionality to moderators. E.g. a module that would allow a moderator to set a user to disabled. Or a module that would allow creating new forums, based on the default forum settings. I see all that as separate functionalities that can be cleanly integrated in a targeted module.

ACL sounds nice, but it is fairly useless. It overcomplicated the admin interface and still, you'd have to implement new interfaces and backend scripts for the features that should show up in the control panel of the moderator user. We like contained code, hence the Phorum module system.

4) Feel free to write the module for that. It is perfectly possible to implement that, but apparently no developer felt the need to implement it.

5) Phorum is not and will not be a mailing list system in its core.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: WYSIWYG Editor for Phorum (edit: CKEditor spamvertisement)
October 17, 2010 03:52AM
Hi Maurice Makaay,
After experimenting with this module for sometime, I realize that the proposed solution of - //I would in such case write a script that would convert all messages in the database to the required format, right before releasing the new editor. That route is fully fail safe.// - is NOT fail safe, because, every new mail that lands on the phorum (from some email account or so fetched by external phorum mail) will have carriage returns in it (and not <br>), along with long trail mails that should be edited out by moderators.
Converting the existing data in database to HTML do not provide any solution to this problem. Only a module or hack that calls the HTML conversion when the new mail lands on the phorum, or when the mail is opened for editing (by moderators) for the first time, only will solve the problem. (i.e. possibly an enhanced version of the current module itself is required to solve this issue).
If HTML conversion is not handled in first edits (usually done by the moderator before approving the mail), the whole line breaks gets quashed, and either the moderator will have to do the whole re-editing or will have to approve an unreadable mail! As of now as a work around, I have reverted to the old version of this module itself which handles HTML conversion in Edits as well. (And I still have the problem of that extra line breaks coming up with multiple edits :( )
If I could get a fix for this issue, it would have been great.
Thanks and Regards,
Sreenadh
Re: WYSIWYG Editor for Phorum (edit: CKEditor spamvertisement)
October 17, 2010 08:30AM
Trust me: conversion of all existing messages before switching to WYSIWYG is the only sensible way.

You are talking about a totally different problem to tackle here. After switching to WYSIWYG, you need to take care of letting all new messages use HTML formatting. So yes, if you do import messages from a mailinglist, then you need to run the HTML formatting on them too before inserting those messages in the database. A hack is a bad proposal, since this can easily be handled by the module / script that takes care of creating the messages. That code could even go a step further and use the HTML formatted body in case the mail client did put that in the message.

You're tackling three different problems here. Don't make up a bad solution to tackle all three of them at once.

And for the record: I do see ways to solve this, but I have no intention on writing the code for you to get this going. I have other parts of Phorum to work on.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login