Firefox PHP

HotEditor WYSIWYG Hack for Phorum 5.1.x

Posted by eCardMAX.com 
HotEditor WYSIWYG Hack for Phorum 5.1.x
June 07, 2007 08:18AM
Quote

##############################################################
## MOD Title: WYSIWYG - Rich Text Editor for posting HTML message
## MOD Author: eCardMAX.com < webmaster@ecardmax.com > (Jimbo Hong) [ecardmax.com]
## MOD Description: It's time to turn <textarea> into a powerful Rich Text HTML Editor. Don't force your users to learn another set of markup tags. With this MOD you can format your posts or Private message just like you would in MS. FrontPage! Our Rich Text Editor will work on all popular browsers such as: IE - FireFox - Netscape - Opera 9x - Safari
## MOD Version: 4.2 for phorum 5.1.22
##
## Installation Level: (Easy)
## Installation Time: 5 ~ 10 Minutes
## Files To Edit:
## include/format_functions.php
## mods/bbcode/bbcode.php
## mods/editor_tools/smileys_panel.php
## templates/default/posting.tpl
## templates/default/cc_usersettings.tpl
## templates/default/pm_post.tpl
## templates/default/posting_messageform.tpl
##
## Included Files: 0
##
## Included Folders: [richedit]
## License: [opensource.org] GNU General Public License v2
##############################################################
## For security purposes, please check: [www.phorum.org]
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at [www.phorum.org]
##############################################################
## Author Notes:
##
## Upload folder [richedit] to phpbb main (root) folder (same location with file admin.php)
##
##############################################################
## MOD History:
##
## 2007-06-07 - Version 4.2
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

It's time to turn <textarea> into a powerful Rich Text HTML Editor. Don't force your users to learn another set of markup tags. With this MOD you can format your posts or Private message just like you would in MS. Word! Our Rich Text Editor will work on all popular browsers such as: IE - FireFox - Netscape - Opera 9x - Safari



NOTE: This Hoteditor will output BBCode instead of HTML code like other WYSIWYG, so your forum will be safe to install this hack.

Phorum & HotEditor DEMO
[www.ecardmax.com]

Information & Download
[www.ecardmax.com]

Hope this help and good luck with you're all.

Jim

eCardMAX products:

eCardMAX ecard server
FormXP 2007 5 in 1 Ajax Form Builder, Survery, Poll, Tell-A-Friend, Mailing List Builder
ePhotoHunt Game - Can you spot a different ?
Free 22 Java Applets
Free Hoteditor - WYSIWYG
Re: HotEditor WYSIWYG Hack for Phorum 5.1.x
June 07, 2007 08:40AM
Good idea but there are a lot of places in there which could (and should!) be turned into a mod to avoid modifying or replacing that many core files.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: HotEditor WYSIWYG Hack for Phorum 5.1.x
June 07, 2007 10:32AM
Please do not edit core files and especially not module files. If you are hacking module files, then it's 100% sure that you can create a separate module which implements the functionality that you need. I also doubt if you really need to hack files like format_functions.php, because modules do have possibilities to hook into the formatting process.

The editor looks great, but I'm a bit afraid about all the support calls that *we* will get after Phorum upgrades are performed, since people will run into errors for sure. Either by overwriting hacked files with new ones, disabling your editor functionality, or by putting back files from your package over new files, possibly overwriting bug fixes that were done for the new Phorum version.

For the smileys, it would be better if the editor smileys button would make use of the smileys that are defined in the Phorum smileys module.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: HotEditor WYSIWYG Hack for Phorum 5.1.x
June 07, 2007 03:49PM
Hi!
Quote

Please do not edit core files and especially not module files. If you are hacking module files, then it's 100% sure that you can create a separate module which implements the functionality that you need
My HotEditor WYSIWYG supports more features such as Font Name, Font Size, Color, Highlight, Strike, Bullets, Numbering, Sub...In order to make all of these features work we need to add extra bbcode parse for them. Phorum already had bbcode parse. Adding extra bbcode parse code to file bbcode.php is a good choice. I think there is no need to create another BBcode mod.

Quote

I also doubt if you really need to hack files like format_functions.php, because modules do have possibilities to hook into the formatting process.
If you read the Hack intruction "Hoteditor_Mod.txt", you will see this:

Quote

#
#-----[ OPEN ]------------------------------------------
#
include/format_functions.php

#
#-----[ FIND ]------------------------------------------
# ~ line number 62

$body = str_replace(array("&","<",">"), array("&amp;","&lt;","&gt;"), $body);

#
#-----[ AFTER, ADD ]------------------------------------------
#

//Hoteditor MOD - Unicode
$body = str_replace("&amp;#","&#",$body);

In the next version, I think you guy should include the code

$body = str_replace("&amp;#","&#",$body);

to support Unicode. For me there is absolutely nothing wrong to add code $body = str_replace("&amp;#","&#",$body); to file format_functions.php

In order to replace <textarea> with WYSIWYG interface, you must edit the template files below
Quote

## templates/default/posting.tpl
## templates/default/cc_usersettings.tpl
## templates/default/pm_post.tpl
## templates/default/posting_messageform.tpl

I have to search for <textarea>...</textarea> and replace it with HotEditor javascript code. There is no way to create a MOD that works on all template without modifying the template files.

By the way, my hack is one of the easiest way to add WYSIWYG to Phorum. You guys can base on it to create a Module. This is the best I can do.

Jim

eCardMAX products:

eCardMAX ecard server
FormXP 2007 5 in 1 Ajax Form Builder, Survery, Poll, Tell-A-Friend, Mailing List Builder
ePhotoHunt Game - Can you spot a different ?
Free 22 Java Applets
Free Hoteditor - WYSIWYG



Edited 1 time(s). Last edit at 06/07/2007 03:49PM by eCardMAX.com.
Re: HotEditor WYSIWYG Hack for Phorum 5.1.x
June 07, 2007 04:15PM
Quote

Adding extra bbcode parse code to file bbcode.php is a good choice.

I don't want to sound ungrateful for your work or anything, but you are kind of missing the point here. Modifying core files is never a good choice if it is possible to handle the required functionality fully from a separate module. The unicode &#.... translation and the extra bbcode tags can all be handled that way. Just copy and rename the bbcode mod to "hoteditor" for example and you should have a decent base to work off.

Modifying the templates is something that can't be easily prevented for this kind of editor replacement, but that's not a problem. Between 5.1.x -> 5.1.y upgrades, the templates are never changed and users should run their customized template, effectively preventing upgrades from overwriting the customized template data.

Also, note that there is a new editor_tools module (as used on this web site too) which is a lot different from the 5.1 "smiley panel". This one handles smileys in a different way. You might want to specifically state in your documentation that editor_tools does not work together with hoteditor.

I do not think that the Phorum devs will pick up this project to turn it into a full clean install, simply because we are currently spending most of their time on getting Phorum 5.2 to an alpha state. Maybe our users can continue developing your code into a more clean solution, if you do not want to follow up on our comments yourself.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: HotEditor WYSIWYG Hack for Phorum 5.1.x
August 27, 2007 04:17AM
will this work for 5.0.13, which is the version I am using. I dare not to upgrade because we have changed database a lot.
Re: HotEditor WYSIWYG Hack for Phorum 5.1.x
August 27, 2007 09:23AM
It will not work. Phorum 5.0.x uses a totally different posting editor system.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: HotEditor WYSIWYG Hack for Phorum 5.1.x
August 27, 2007 04:45PM
Is there any BBCode editor that will work for 5.0.13?

I appreciate your reply.
Re: HotEditor WYSIWYG Hack for Phorum 5.1.x
August 27, 2007 04:55PM
None that I know of.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: HotEditor WYSIWYG Hack for Phorum 5.1.x
August 27, 2007 05:25PM
And upgrading to 5.1.x is REALLY recommended even more because of security fixes.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Sorry, only registered users may post in this forum.

Click here to login