I was looking for a methode to replace the XOOPS editor with a wysiwyg editor. With nuke i used Htmlarea which is not a very good editor and gives a lot of errors even when correctly installed (IMHO, i'm sorry). After a while i found
SPAW. This is a perfect wysiwyg editor, looks nice and has a lot features.
I've hacked the XOOPS news module, only a few modification are necessary, and it works great! Below is how this can be done:
1) Download SPAW
2) Extract it in the /include dir (i.e. /include/spaw) and configure /include/spaw/config/spaw_control.config.php
3) Open modules/news/admin/storyform.inc.php in your editor
4) From here you have two options.
Download my hacked storyform.inc.php or make the modification below:
After:
}
include XOOPS_ROOT_PATH."/include/xoopscodes.php";
if(!isset($submit_page)){
$submit_page = $HTTP_SERVER_VARS['PHP_SELF'];
}
Add:
$_root = XOOPS_ROOT_PATH;
define('DR', $_root);
unset($_root);
$spaw_root = DR.'/include/spaw/';
include $spaw_root.'spaw_control.class.php';
$spaw_dropdown_data['style']['default'] = 'No styles';
$spaw_dropdown_data['style']['style1'] = 'Style no. 1';
$spaw_dropdown_data['style']['style2'] = 'Style no. 2';
After:
echo "</p><p><b>"._AM_INTROTEXT."</b><br /><br />\n";
Add:
if (isset($HTTP_GET_VARS)) {
foreach ($HTTP_GET_VARS as $k => $v) {
$$k = $v;
}
}
$sw = new SPAW_Wysiwyg('hometext' /*name*/, $hometext /*value*/,'eng' /*language*/, 'full' /*toolbar mode*/, 'default' /*theme*/,'100%' /*width*/, '450px' /*height*/);
$sw->show();
Remark/delete: xoopsCodeTarea("hometext", 60, 15);
After:
echo "<br /></p><p><b>"._AM_EXTEXT."</b><br /><br />\n";
Add:
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
$bodytext = strtr ($bodytext, $trans_tbl);
$sw = new SPAW_Wysiwyg('bodytext' /*name*/, $bodytext /*value*/,'eng' /*language*/, 'full' /*toolbar mode*/, 'default' /*theme*/,'100%' /*width*/, '450px' /*height*/);
$sw->show();
Remark/delete: xoopsCodeTarea("bodytext", 60, 15, 2);
And that's 'all'
Now you have a perfect wysiwyg editor for XOOPS news.
No matter what methode you decide to use, download my version or make the modfications yourself, PLEASE make a backup first and create some test-content first!!!!!!!
Happy SPAW/Xoopsing :)
Jan Koetze
WWW.KOETZE.NET