Posted on: 03/06/05 08:43am
By: holla
Folks,
I'm posting my instructions here for the next poor soul to undertake htmlarea.
htmlarea install
cd /tmp
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/itools-htmlarea login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/itools-htmlarea co -P htmlarea
cd htmlarea
mkdir builds
./make-release.pl
mv builds/HTMLArea-3.0-RC3 to /path/to/geeklog/htmlarea
cd /path/to/geeklog
find htmlarea/ -type f -exec chmod 644 {} ;
find htmlarea/ -type d -exec chmod 755 {} ;
find htmlarea/ -name "*.cgi" -exec chmod 755 {} ;
check your install by browsing to
http://yoursite/lhtmlarea the online demos should work, try core.html
modifications to /path/to/geeklog/layout/yourlayout/admin/story/storyeditor.thtml
add this at the top
<script type="text/javascript">
_editor_url = "/htmlarea/";
_editor_lang = "en";
</script>
<script type="text/javascript" src="/htmlarea/htmlarea.js"></script>
<script type="text/javascript">
HTMLArea.onload = function() {
var editor1 = new HTMLArea("editor1"
;
editor1.config.toolbar = [
[
"bold", "italic", "separator",
"orderedlist", "unorderedlist", "separator",
"inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
"copy", "cut", "paste", "space", "undo", "redo", "space", "removeformat", "killword"
]
];
editor1.generate();
var editor2 = new HTMLArea("editor2"
;
editor2.config.toolbar = [
[
"bold", "italic", "separator",
"orderedlist", "unorderedlist", "separator",
"inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
"copy", "cut", "paste", "space", "undo", "redo", "space", "removeformat", "killword"
]
];
editor2.generate();
};
HTMLArea.init();
/*
this is from htmlarea.js, we are eliminating some buttons because geeklog will remove tags
this.toolbar = [
[ "fontname", "space",
"fontsize", "space",
"formatblock", "space",
"bold", "italic", "underline", "strikethrough", "separator",
"subscript", "superscript", "separator",
"copy", "cut", "paste", "space", "undo", "redo", "space", "removeformat", "killword" ],
[
"justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
"lefttoright", "righttoleft", "separator",
"orderedlist", "unorderedlist", "outdent", "indent", "separator",
"forecolor", "hilitecolor", "separator",
"inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
"popupeditor", "separator", "showhelp", "about" ]
];
*/
</script>
Still in /path/to/geeklog/layout/yourlayout/admin/story/storyeditor.thtml
add id="editor1" and id="editor2" to textfields , like this
<td><textarea name="introtext" id="editor1" cols="98" rows="12" wrap="virtual">{story_introtext}</textarea></td>
replace "Post Mode" table tr with this, don't let user select between 'Plain old text' and 'html'
<tr><td></td><td>{lang_allowed_html}<input type="hidden" name="postmode" value="html"></td></tr>
htmlarea kicks out an extra carriage return/linefeed when blank textareas are returned.
This blank whitespace gets stored in db as bodytext, then geeklog thinks there's "more" to the story.
Now in /path/to/geeklog/admin/story.php
in the clean up section, look for 'html', then add a rtrim to get rid of the last trailing cr/lf
$bodytext = COM_checkHTML (COM_checkWords (rtrim($bodytext," \\r\\n"
));
When stories are submitted, firefox shows a blank screen
Edit lib-common.php, replace COM_refresh with this
function COM_refresh( $url )
{
return "<html><head><SCRIPT LANGUAGE=\\"JavaScript\\">redirTime = \\"100\\"; redirURL = \\"$ur\\l"; function redirTimer() { self.setTimeout(\\"self.location.href = redirURL;\\",redirTime); } </script></head><body onLoad=\\"redirTimer()\\"></body></html>";
}
Hope this helps. Thanks to everyone who's contributed on this subject already.
Craig
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 03/06/05 01:32pm
By: Anonymous (danMc)
Did you see this in the download section:
Professional Theme With Built-in WYSIWYG
http://www.geeklog.net/filemgmt/singlefile.php?lid=464
And check my comment about what to change in the config.php file so that tags are not stipped out.
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 03/07/05 02:07pm
By: holla
Thanks, I'll take a look. Was you approach similar to mine?
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 03/07/05 04:01pm
By: geKow
....and was it for HTMLarea 3? or is there no difference?
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 03/07/05 04:46pm
By: geKow
oh and... I would suggest to make a copy of storyeditor.thtml and rename ist to advanced_storyeditor.thtml. Than open config.php and set $_CONF['advanced_editor'] = true;
this way you keep your old settings and can switch between HTMLarea and not.
(tip from Blaine)
geKow
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 03/07/05 09:13pm
By: Anonymous (dan Mc)
[QUOTE BY= holla] Thanks, I'll take a look. Was you approach similar to mine?[/QUOTE]
No - I am not that smart... I'm not even sure what your instructions are saying. I only have ftp acces to my server. Your instructions look like you have command line access.
I used the pre made theme files provided in the modified professional theme, then, tackled the changes to the config.php in the allowed html area. I only added to the admin area as I don't know what problems I might be opening up if I let everyone have ability to do this. I have no idea what array this or that is, I just tinkered and trial and error with different tags to get it to work.
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 03/07/05 09:21pm
By: holla
Folks,
After spending a couple hours figuring out how the 'story admin' functionality works, I see that its quite a bit of work to give the normal users the ability to insert images like the admins. The whole preview thing is also a pain. I'm abandoning that effect and have moved to FCKeditor, which includes an integrated file uploader. I got the user submit story running with fckeditor in about 10 minutes. Now I'm tweaking things. I'll report back on my setup when complete.
Thanks,
Craig
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 03/16/05 11:33am
By: Anonymous (phpsocialclub)
I must say that so far FCKeditor is alot easier than HTML area,
I have installed HTMLarea 2.0 and 3.0 in GL sites and I just did FCKeditor in about 5 minutes, once I decided to read the docs.
I have not tried the image upload yet, but I assume that will work as advertised.
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 03/16/05 11:55am
By: holla
No doubt, I've also switched to FCKeditor. It works great in IE6 and Firefox. Not in Safari though, but I have a friend working on that. When I get FCKeditor running for another site, I'll document my instructions to this forum much like my instructions for HTMLArea.
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/18/05 02:55pm
By: jnordquist
I have FCKEditor running on
kenoshaonline.net[*1] but the image insert function does not seem to work. Even with an absolute url, when I save the story of comment, the image is deleted in the source and all that is left is
<img alt="" />
. Did you have better luck?
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/18/05 03:10pm
By: jnordquist
Also, when saving a new story or comment, the result works, you get a blank page. If you go you view the page you were creating, it's there, but unlike the standard GL editor save, which takes you to the list of stories when you click save, this takes you to an empty page.
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/18/05 04:21pm
By: jnordquist
Okay, the image thing was simply an oversight (isn't it usually?). I forgot to add the allowable html in config.php to enable images in stories.
The blank page is still a mystery.
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/26/05 09:59pm
By: mevans
The blank page is still a mystery.
For some reason, whenever you integrate any of the WYSIWYG editors, it breaks the COM_refresh() function. This is what is causing the blank page after a save, the refresh to reload the URL is not working.
A quick hack to fix it for me was to replace the following line in lib-common.php (COM_refresh() function):
old code
return "<html><head><meta http-equiv="refresh" content="0; URL=$url"></head></html>n";
new code
header("Location: " . $url);
I'm not sure why the meta refresh was chosen instead of using the php header() function, but this did fix the problem for me, your milage may vary...
As a side note, I'm actually using SPAW editor with GeekLog and it works very well, including the image upload. No new javascript necessary, just took a couple of small hacks to story.php, created the storyeditor_advanced.thml file and updated config.php to not filter the HTML and all is well. But, keep in mind, I don't run sites that allow user editing, either I do it or one of my trusted admins do it, so the security concerns are not that great for my situation. I haven't really looked at the implications of turning it on for public use or in comments.
If you are interested, I will post the actual modifications to story.php and put a little more effort in documenting how it was done.
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/26/05 11:15pm
By: jnordquist
Thanks for the refresh fix! It was driving me nuts!
I would be very interested in the SPAW editor. I do have public input, but we monitor pretty closely.
Many thanks!
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/27/05 12:12am
By: mevans
How to install the SPAW Wysiwyg editor in GeekLog 1.3.11
1. Download SPAW - http://www.solmetra.com/en/disp.php/en_products/en_spaw/en_spaw_intro
2. Install in the /spaw/ directory under public_html
3. Configure SPAW to work in your environment, test using the
http://your_url.com/spaw/scripts/demo.php
NOTE: You must do this test BEFORE you perform the hack below, because it will
break the demo.
3. SPAW Hack
You must change SPAW to not actually execute the editor, but instead return the HTML.
edit spaw_control.class.php
At the bottom of the file, change function show() to:
change echo $this->getHtml(); to return $this->getHtml()
4. Geeklog Hacks
Edit admin/story.php
Add the following lines after 'require_once('auth.inc.php');
$spaw_root = $_CONF['path_html'] . '/spaw/';
require($spaw_root . 'spaw_control.class.php');
Around line 493 add the following 3 lines after: $newintro = str_replace('}','}',$newintro);
$sw = new SPAW_Wysiwyg('introtext',$newintro,'en','full');
$spaw_introtext = $sw->show();
$story_templates->set_var('spaw_introtext',$spaw_introtext);
A few lines down, add the following 3 lines after: $newbody = str_replace('}','}',$newbody);
$sw_body = new SPAW_Wysiwyg('bodytext',$newbody,'en','full');
$spaw_bodytext = $sw_body->show();
$story_templates->set_var('spaw_bodytext',$spaw_bodytext);
That's it for the story.php hacks.
5. Create storyeditor_advanced.thtml in layout/YOURTHEMEHERE/admin/story/
- Copy storyeditor.thtml to storyeditor_advanced.thtml
Edit storyeditor_advanced.thtml
Find the line that looks like this (may vary depending on theme)
<textarea name="introtext" cols="50" rows="12">{story_introtext}</textarea>
Replace this with
{spaw_introtext}
So you will end up with something like: <td>{spaw_introtext}</td>
Next find the line that looks like
<textarea name="bodytext" cols="50" rows="15">{story_bodytext}</textarea>
Replace with:
{spaw_bodytext}
So you will end up with something like: <td>{spaw_bodytext}</td>
That's it for the edits
6. Update your config.php to enable advanced editing
$_CONF['advanced_editor'] = true;
7. Update your config.php to NOT filter some additional HTML
NOTE: I am not sure what the security implications are for this, I personally
am the only one who edits stories on my sites, so it is not a big issue for me.
Proceed with caution...
Here is what I have in my config.php for $_CONF['admin_html'] and it seems to handle
most of the SPAW commands.
$_CONF['admin_html'] = array (
'p' => array('class' => 1, 'id' => 1, 'align' => 1),
'div' => array('class' => 1, 'id' => 1, 'style' => 1),
'span' => array('class' => 1, 'id' => 1, 'style' => 1, 'color' => 1, 'rgb' => 1),
'table' => array('class' => 1, 'id' => 1, 'width' => 1, 'border' => 1,
'cellspacing' => 1, 'cellpadding' => 1, 'style' => 1,
'bgcolor' => 1),
'tr' => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1, 'style' => 1, 'bgcolor' => 1),
'th' => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1,
'colspan' => 1, 'rowspan' => 1),
'td' => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1,
'colspan' => 1, 'rowspan' => 1, 'style' => 1, 'bgcolor' => 1),
'tbody' => array('style' => 1),
'img' => array('src' => 1, 'style' => 1, 'align' => 1, 'width' => 1,
'height' => 1),
'onclick' => array('window.open' => 1),
'sup' => array(),
'sub' => array()
);
8. If you receive a blank page after saving a story, apply the following hack.
For some reason, each Wysiwyg editor I have tried has broken COM_refresh()
in lib-common.php. Here is what I did to fix it:
Find COM_refresh() function in lib-common.php and change it to:
header("Location: " . $url);
9. You are done!
NOTES: This does not enable the Wysiwyg editor for comments or static pages. I haven't actually done
it for comments, but I would imagine it isn't much different from the above, just find the right
files to edit and the approach should work fine.
For staticpages, I have done it and it seems to work fine.
Add the following lines near the top of admin/plugins/staticpages/index.php (right after the 2 require_once..)
$spaw_root = $_CONF['path_html'] . '/spaw/';
require($spaw_root . 'spaw_control.class.php');
Look in admin/plugins/staticpages/index.php around line 285 for:
$sp_template->set_var('sp_content', htmlspecialchars (stripslashes($A['sp_content'])));
Add the following lines ABOVE this line:
$sw = new SPAW_Wysiwyg('sp_content',stripslashes($A['sp_content']),'en','full');
$sp_content = $sw->show();
$sp_template->set_var('spaw_sp_content',$sp_content);
You will need to create the editor_advanced.thtml in the /plugins/staticpages/templates/admin/
directory and change the following code:
<textarea name="sp_content" cols="75" rows="24" wrap="virtual">{sp_content}</textarea>
To
{spaw_sp_content}
Staticpages should not be handled using the Wysiwyg editor too.
Good Luck
That is it! Hopefully it will work for you, if not please feel free to email me.
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/27/05 10:24am
By: Anonymous (duvide)
What a great instruction! It's the first time that I actually got an html editor to work with geeklog, especially with the stories. Thank you!
When I tried to make it work with staticpages I get this error though:
Fatal error: Cannot instantiate non-existent class: spaw_wysiwyg in /home/xxx/domains/xxx.com/public_html/admin/plugins/staticpages/index.php on line 285
Do you have any suggetions here?
Thank you/Frank
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/27/05 10:28am
By: mevans
Sorry, I forgot one step in the static page installation:
Add the following lines somewhere near the top of index.php in public_html/admin/plugins/staticpages/index.php
I put them right after the two require_once lines near the top.
$spaw_root = $_CONF['path_html'] . '/spaw/';
require($spaw_root . 'spaw_control.class.php');
This should get you going with static pages too.
Thanks!
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/27/05 11:49am
By: jnordquist
I am almost there with spaw...
The editor boxes come up, but no buttons work and the text box won't allow for a cursor to appear when clicking in it...
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/27/05 12:05pm
By: mevans
I am almost there with spaw...
The editor boxes come up, but no buttons work and the text box won't allow for a cursor to appear when clicking in it...
Did the demo work? Remember, that one of the changes I noted above will actually break the demo, but if you start from scratch, make sure the demo.php is working first that will remove SPAW configuration issues out of the trouble shooting.
If the demo is working, but not in Geeklog, I'm not sure what the problem might be. Just off the top of my head, if you tried any of the other Wysiwyg editors, is there any old javascript hanging around in your headers? Have you checked it in a different browser (I use firefox 1.04 without issues)?
Good Luck!
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 05/27/05 01:10pm
By: Anonymous (duvide)
You know your stuff, mevan!
With the 2 lines put in, it is even working in staticpages.
Great job, thanks/Frank
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 06/01/05 04:40pm
By: samstone
Just for your information, I have been using HTMLArea for years without problem. As for file uploading, you need to install the ImageManager plugin. I have mentioned elsewhere before regarding the setup.
Good to know additional choices of HTML editors. If my HTMLArea broke I now have other choices.
Sam
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 06/01/05 04:54pm
By: drshakagee
Since you have a such a nice step by step tutorial, I suggest you
submit it as a story[*2] here on gl.net. I almost missed this thread and I am sure many others missed it as well.
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 06/18/05 08:25pm
By: Anonymous (Shock & Awe)
I am totally "shocked and awed" by mevans' detailed instructions for integrating SPAW into my 1.3.11 install. Good going, guy! For a senior novice, it took me about 30 minutes to carefully and prudently implement the hack, and the darn thing worked straight off!
Even imports, pastes images, etc., something that seemed to be problematic with some other editors. The only nits that I have noticed are:
- it's slow (on a stand-alone Barton with 1 gig), but roughly on-par with the freebie HtmlArea 3XTD or whatnot that I have on my Mambo 1.5.2 site, which I'm migrating to GL for the commenting. Mambo doesn't have a decent commenting function/plug-in yet, although they are trying and the AKOcomment plug-in works pretty fine (but no comment management capability to speak of).
- for some reason, I don't get the little popups when I mouse-over the various symbols. In time I will get used to not having the fuctions written out for me, but it's just a nt in the overall list of priorities. Anyone got the popups to work?
- SPAW's theme swapping does allow changing from "default" to "classic" theme (I gotta get rid of that Sub-Silver-like set of 3 bars in the "default" theme, though. However, for me, none of the toolbar changes I selected from the various subdirectories seemed to change anything. Perhaps I did something wrong.
Anyway, thanks a lot ... It's a great editor implementation.
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 06/22/05 01:22pm
By: sorenson2743
I spoke too soon. The Spaw implementation went flawlessly as I said above, but afterwards the "Reply" button functionality is broken ... just dumps the user (unregistered, registered or admin) back to the front page. Since I set "nested" as the default, it wouldn't be long until the replys started moving off the right side of the page using the normal "reply to this post" underneath the latest comment. So I backed out Spaw and am now looking at alternatives. I may try FCK or HtmlArea, any input on what's easier, foolproof, and works?
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 06/23/05 02:12pm
By: samstone
Are you related to Sorenson Squeez? I like the software.
The easiest way is to wait untile 1.3.12 come out, which will come with FCKeditor as an option for advanced text editor that you can simply turn it on in config.php.
If you can't wait just try the CVS.
Sam
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 06/23/05 07:55pm
By: digitalfiasco
[QUOTE BY= samstone] Are you related to Sorenson Squeez? I like the software.
The easiest way is to wait untile 1.3.12 come out, which will come with FCKeditor as an option for advanced text editor that you can simply turn it on in config.php.
If you can't wait just try the CVS.
Sam[/QUOTE]
Dude, I didn't know there was a CVS for 1.3.12 available! Thanks for the info. Gotta try that badboy out.
jOe
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 06/23/05 09:28pm
By: samstone
Two ways to try. One is by going to the CVS repository. Or you can sign up for the nightly tarball. The CVS link is on the left column of this web site, or click
here[*3]
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 06/23/05 10:34pm
By: digitalfiasco
Actually, I use TortoiseCVS to retrieve it.
Anyway, I'm glad FCKeditor is finally easy to activate in config.php. Already upgraded the site and the integration looks good.
jOe
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 01/30/06 12:16am
By: deek
I just got done installing SPAW with my 1.3.11 install, no problems. What I want to do now is use it the admin mail part. Any suggestion on where to put the code
Around line 493 add the following 3 lines after: $newintro = str_replace('}','}',$newintro);
$sw = new SPAW_Wysiwyg('introtext',$newintro,'en','full');
$spaw_introtext = $sw->show();
$story_templates->set_var('spaw_introtext',$spaw_introtext);
but for the admin/mail.php file?
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 02/02/06 09:06pm
By: deek
anyone?
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 02/02/06 09:35pm
By: samstone
I guess most of us have moved to GL 1.4 that comes installed with FCK editor and don't want to bother with trying to install an HTML editor to 1.3.11 anymore.
Why do you want to stay with 1.3.11?
Sam
GL 1.3.11 with htmlarea 3.0 RC3 install instructions
Posted on: 02/02/06 10:11pm
By: deek
The site that I am maintaing is for the Crew team at my college and it is very important. I have made alot of little modifications that i havn't kept track of (stupid me) and being a college student I don't have time to fix any major problems that might arise during an upgrade. I will be upgrading during spring break but I have to hobble along right now.
Derek