1
fredski
wysiwyg for news - spaw
  • 2004/10/11 15:00

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


I'm in need of a good wysiwyg editor for my news and article content, I have the spaw module installed and after reading the readme file that came with spaw, Im still lost on how to integrate it to my news and articles as the instructions arent clear. I need to allow admins and users to use it.

2
fredski
Re:wysiwyg for news - spaw
  • 2004/10/12 8:21

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


For instance, it says
Quote:
Add these these lines to as near to the top of the page as possible, just below admin_header include:


//Insert start
$module_handler = &xoops_gethandler('module');
$module = &$module_handler->getByDirname('spaw');

if (is_object($module) && $module->getVar('isactive'))
{
include_once XOOPS_ROOT_PATH . "/modules/spaw/spaw_control.class.php";
}
//insert finish


Does that mean your theme template page or some page in the news module?

Next it says
Quote:
To include spaw with XoopsFormClass, use the following:

ob_start();
$sw = new SPAW_Wysiwyg('page', $page, 'en', 'full', 'default', '99%', '600px');
$sw->show();
$sform->addElement(new XoopsFormLabel("You text here", ob_get_contents(), 1));
ob_end_clean();

You will need to use ob_start(), ob_get_contents and ob_clean.


Where the heck does that go????? if I'm reading it right it dosn't go anywhere, its just an example of what you would put in a module to get it to work with spaw, but it's not clear.
The next bit is the altered version of the above to work with the news module.

Quote:

echo "</p><p><b>"._AM_INTROTEXT."</b><br /><br />\n";
//xoopsCodeTarea("hometext", 60, 15);
$sw = new SPAW_Wysiwyg( 'hometext', $hometext, 'en', 'full', 'default', '99%', '600px' );
$sw -> show();
xoopsSmilies("hometext");


Problem is it dosent say where you should insert that piece of code or if that piece of code needs to replace some other code.

The only code it tells you how to edit clearly is the last bit regarding the way modules display the data, as XOOPS auto converts linebreaks.

Can anyone shed a bit more light on this, and let me know which files to edit.
Thanx

3
rcjohnson
Re:wysiwyg for news - spaw
  • 2004/10/13 17:58

  • rcjohnson

  • Not too shy to talk

  • Posts: 187

  • Since: 2004/7/23


I had the same problems. I wanted a good wysiwyg editor, but after looking at the intallation instuctions, figured Id just use the good ol' copy and paste method.

4
fredski
Re:wysiwyg for news - spaw
  • 2004/10/15 8:31

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


Come on guy's and girls, give me a clue here. Out of the hundreds of people who have viewed this thread, no one has given me the answer.

5
siweb
Re:wysiwyg for news - spaw
  • 2004/10/15 9:33

  • siweb

  • Not too shy to talk

  • Posts: 150

  • Since: 2004/5/2 1


Try Koivi editor. It includes example of integrating WYSIWYG in News module. You can find it here

6
fredski
Re:wysiwyg for news - spaw
  • 2004/10/15 13:48

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


I downloaded the editor, put the wysxiwyg folder into the xoopx/class folder. Copied the imagemanager.html into the xoops/includes folder.

I then read the instructions for adding it to the news module. The instructions dont match mny file.
The instructions are as follows
1º Open file news/include/storyform.inc.php 

2º After line 32 
(include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";) add:


[
quote]include_once XOOPS_ROOT_PATH "/class/wysiwyg/formwysiwygtextarea.php";[/quote]
3º Remove or comment line 61 ($sform->addElement(new XoopsFormDhtmlTextArea(_NW_THESCOOP'hometext'$hometext1560'hometext_hidden'), true);) and add:


[
quote]$sform->addElement(new XoopsFormWysiwygTextArea_NW_THESCOOP'hometext'$hometext'100%''400px',''), true);[/quote
3º Remove or comment line 66 ($sform->addElement(new XoopsFormDhtmlTextArea(_AM_EXTEXT'bodytext'$bodytext1560'bodytext_hidden'), false);) and add:


[
quote]$sform->addElement(new XoopsFormWysiwygTextArea_AM_EXTEXT'bodytext'$bodytext'100%''400px',''), true);[/quote]


but my code for storyform.inc.php is
<?php
// $Id: storyform.inc.php,v 1.1 2004/01/29 14:45:49 buennagel Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //

include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$sform = new XoopsThemeForm(_NW_SUBMITNEWS"storyform"xoops_getenv('PHP_SELF'));
$sform->addElement(new XoopsFormText(_NW_TITLE'subject'5080$subject), true);
ob_start();
$xt->makeTopicSelBox(0);
$sform->addElement(new XoopsFormLabel(_NW_TOPICob_get_contents()));
ob_end_clean();
$sform->addElement($topic_select);
$sform->addElement(new XoopsFormDhtmlTextArea(_NW_THESCOOP'message'$message1560), true);
$option_tray = new XoopsFormElementTray(_OPTIONS,'<br />');
if (
$xoopsUser) {
    if (
$xoopsConfig['anonpost'] == 1) {
        
$noname_checkbox = new XoopsFormCheckBox('''noname'$noname);
        
$noname_checkbox->addOption(1_POSTANON);
        
$option_tray->addElement($noname_checkbox);
    }
    
$notify_checkbox = new XoopsFormCheckBox('''notifypub'$notifypub);
    
$notify_checkbox->addOption(1_NW_NOTIFYPUBLISH);
    
$option_tray->addElement($notify_checkbox);
    if (
$xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
        
$nohtml_checkbox = new XoopsFormCheckBox('''nohtml'$nohtml);
        
$nohtml_checkbox->addOption(1_DISABLEHTML);
        
$option_tray->addElement($nohtml_checkbox);
    }
}
$smiley_checkbox = new XoopsFormCheckBox('''nosmiley'$nosmiley);
$smiley_checkbox->addOption(1_DISABLESMILEY);
$option_tray->addElement($smiley_checkbox);
$sform->addElement($option_tray);
$button_tray = new XoopsFormElementTray('' ,'');
$button_tray->addElement(new XoopsFormButton('''preview'_PREVIEW'submit'));
$button_tray->addElement(new XoopsFormButton('''post'_NW_POST'submit'));
$sform->addElement($button_tray);
$sform->display();
?>


As you can see. the instructions dont match the file.

Anyone know what to do?

7
siweb
Re:wysiwyg for news - spaw
  • 2004/10/17 10:53

  • siweb

  • Not too shy to talk

  • Posts: 150

  • Since: 2004/5/2 1


Example is obviously for News 1.2.1.

8
JackJ
Re:wysiwyg for news - spaw
  • 2004/10/17 11:45

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


I currently use Chapi's News with Spaw hack and it has the linebreaks text sanitizor thing catered for so no extra unwanted vast spaces in the HTML output. you could spend hours doing this but the XOOPS linebreaks thing will ruin your html output.

Chapis News Hack, they have moved it I think to the new downloads module

https://xoops.org/modules/news/article.php?storyid=1128

It does not work with the new news module 1.2x from the dev site.

p.s Edit. I don't know about you but I hate these new forums and the scrolling right to try and see the posts, it looks so unpro.. Image sizes should be limited and quotes through everything right out.. (getting old and cranky) Will be great when this is sorted though..

9
fredski
Re:wysiwyg for news - spaw
  • 2004/10/18 9:54

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


Quote:

siweb wrote:
Example is obviously for News 1.2.1.


Oh yeah. well that was obvious, err wasnt it.

Lol

10
wabaha
Re:wysiwyg for news - spaw
  • 2005/1/31 21:16

  • wabaha

  • Just popping in

  • Posts: 1

  • Since: 2005/1/31


Hi,

I can not find Chapis News Hack any more.
Do you know where to get it?

Thanks a lot for your help.

Login

Who's Online

199 user(s) are online (136 user(s) are browsing Support Forums)


Members: 0


Guests: 199


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