1
ezteok
How to use SPAW wysiwyg editor with the News module!
  • 2003/10/23 11:15

  • ezteok

  • Just popping in

  • Posts: 3

  • Since: 2003/7/21


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

2
migoe
Re: How to use SPAW wysiwyg editor with the News module!
  • 2003/10/23 13:25

  • migoe

  • Just popping in

  • Posts: 68

  • Since: 2003/4/2 9


Hello Jan,

a good script an an easy way to implement it - but at my site it doesnt work
I have everything done how you wrote (used the downloaded file) but wenn i want to submit a new Article in the news-modul there comes a white screen and an error message: Access denied!

What have i done to deserve this?

migoe

P.S. Using X2.05

3
ezteok
Re: How to use SPAW wysiwyg editor with the News module!
  • 2003/10/23 13:55

  • ezteok

  • Just popping in

  • Posts: 3

  • Since: 2003/7/21


Hmm i'm using x2.05 to so that can't be the problem. I can post and edit articles with no error whatsoever... What generates this message? I mean is it a xoops, apache or browser message? And, if it is apache, are you using mod_security? And how about the owner (rights) of the dir you create?

Jan

4
Herko
Re: How to use SPAW wysiwyg editor with the News module!
  • 2003/10/23 14:06

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Catzwolf made the spaw editor part of his new (yet to be released) WF-Sections module. totally integrated into xoops. It only works on IE, tho.

Herko

5
ezteok
Re: How to use SPAW wysiwyg editor with the News module!
  • 2003/10/23 19:56

  • ezteok

  • Just popping in

  • Posts: 3

  • Since: 2003/7/21


Now we are talking And when will this release be? Soon i hope because every self respecting CMS should have a decent editor... IMHO

Grtnx,

Jan

6
ralf57
Re: How to use SPAW wysiwyg editor with the News module!
  • 2003/10/23 21:39

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi ezteok,
i've installed your hack on a XOOPS 2.05 system and the installation was quite simple.
Now i found a "little" problem.
When i compose a new article and preview it,the preview area shows the html source code instead of what i have composed.
The same happens when i edit a published article.
The strange is that this doesn't happen if i directly save the article without preview.
I think this should depend on the way XOOPS deal with html code and tags,but i can't find a solution to his.
Hope you will.
Regards,ralf.

7
PureLuXus
Re: How to use SPAW wysiwyg editor with the News module!
  • 2003/10/24 0:26

  • PureLuXus

  • Not too shy to talk

  • Posts: 116

  • Since: 2002/1/3 2


Quote:

Herko Coomans wrote:
It only works on IE, tho.


8
migoe
Re: How to use SPAW wysiwyg editor with the News module!
  • 2003/10/24 19:42

  • migoe

  • Just popping in

  • Posts: 68

  • Since: 2003/4/2 9


Hi Jan,

no, the server dont use mod_security - the following mods are loaded:

mod_php4mod_setenvifmod_somod_expiresmod_authmod_accessmod_rewritemod_aliasmod_userdirmod_actionsmod_imapmod_asismod_cgimod_dirmod_autoindexmod_includemod_infomod_statusmod_negotiationmod_mimemod_log_referermod_log_agentmod_log_configmod_envmod_vhost_aliashttp_core


I have an idea: there are some files ".cvsignore" in the /spaw directory that i dont can upload to the server - permission fail - can this failing files be the problem? And when yes, how can i help myself?
Or can it be, that my settings in the /spaw/config/spaw_control.default.config.php are wrong?

// directory where spaw files are located
$spaw_dir '/spaw/';

// base url for images
$spaw_base_url 'http://www.liedermacher-forum.de/images/';

if (!
ereg('/$'$HTTP_SERVER_VARS['DOCUMENT_ROOT']))
  
$spaw_root $HTTP_SERVER_VARS['DOCUMENT_ROOT'].$spaw_dir;
else
  
$spaw_root $HTTP_SERVER_VARS['DOCUMENT_ROOT'].substr($spaw_dir,1,strlen($spaw_dir)-1);


$spaw_default_toolbars 'default';
$spaw_default_theme 'default';
$spaw_default_lang 'en';
$spaw_default_css_stylesheet $spaw_dir.'wysiwyg.css';

// add javascript inline or via separate file
$spaw_inline_js false;

// use active toolbar (reflecting current style) or static
$spaw_active_toolbar true;

// default dropdown content
$spaw_dropdown_data['style']['default'] = 'Normal';

$spaw_dropdown_data['font']['Arial'] = 'Arial';
$spaw_dropdown_data['font']['Courier'] = 'Courier';
$spaw_dropdown_data['font']['Tahoma'] = 'Tahoma';
$spaw_dropdown_data['font']['Times New Roman'] = 'Times';
$spaw_dropdown_data['font']['Verdana'] = 'Verdana';

$spaw_dropdown_data['fontsize']['1'] = '1';
$spaw_dropdown_data['fontsize']['2'] = '2';
$spaw_dropdown_data['fontsize']['3'] = '3';
$spaw_dropdown_data['fontsize']['4'] = '4';
$spaw_dropdown_data['fontsize']['5'] = '5';
$spaw_dropdown_data['fontsize']['6'] = '6';

$spaw_dropdown_data['paragraph']['Normal'] = 'Normal';
$spaw_dropdown_data['paragraph']['Heading 1'] = 'Heading 1';
$spaw_dropdown_data['paragraph']['Heading 2'] = 'Heading 2';
$spaw_dropdown_data['paragraph']['Heading 3'] = 'Heading 3';
$spaw_dropdown_data['paragraph']['Heading 4'] = 'Heading 4';
$spaw_dropdown_data['paragraph']['Heading 5'] = 'Heading 5';
$spaw_dropdown_data['paragraph']['Heading 6'] = 'Heading 6';

// image library related config

// allowed extentions for uploaded image files
$spaw_valid_imgs = array('gif''jpg''jpeg''png');

// allow upload in image library
$spaw_upload_allowed true;

// image libraries
$spaw_imglibs = array(
  array(
    
'value'   => 'images/',
    
'text'    => 'Bilder',
  ),
  array(
    
'value'   => 'images/',
    
'text'    => 'Bilder2',
  ),
);


In hope of an helping answer...

migoe

9
migoe
Re: How to use SPAW wysiwyg editor with the News module!
  • 2003/10/28 21:23

  • migoe

  • Just popping in

  • Posts: 68

  • Since: 2003/4/2 9


I have run the demo.php in /spaw/scripts/ an this ist the errormessages:

This is the simpliest usage of the control with all the default parameters

$sw 
= new SPAW_Wysiwyg('spaw1',stripslashes($HTTP_POST_VARS['spaw1']));
$sw->show();


Fatal errorCannot instantiate non-existent class: spaw_wysiwyg in /raid/domains/de/l/liedermacher-forum/htdocs/www/include/spaw/scripts/demo.php on line 67


Can anyone help me to run the script?

migoe

10
JohnDoo
Re: How to use SPAW wysiwyg editor with the News module!
  • 2003/10/30 3:02

  • JohnDoo

  • Just popping in

  • Posts: 14

  • Since: 2003/9/30


Try inserting these lines...

$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
$hometext = strtr ($hometext, $trans_tbl);

...just before:

$sw = new SPAW_Wysiwyg('hometext' /*name*/, $hometext /*value*/,'eng' /*language*/, 'full' /*toolbar mode*/, 'default' /*theme*/,'100%' /*width*/, '450px' /*height*/);

Regards,
JohnDoo.

Login

Who's Online

208 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 208


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits