Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
4 + 8 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
>xt_wysiwyg [1]'; /* // SPAW Config $spaw_root = XOOPS_ROOT_PATH.'/modules/xt_conteudo/admin/spaw/'; include $spaw_root.'spaw_control.class.php'; if (checkBrowser()) { ob_start(); $sw = new SPAW_Wysiwyg('message',$message); $sw->show(); $form->addElement(new XoopsFormLabel(_TC2_CONTENT, ob_get_contents())); ob_end_clean(); } else { $t_area = new XoopsFormDhtmlTextArea(_TC2_CONTENT, 'message', '', 37, 35); $form->addElement($t_area); } */ // ------------------------------------------------------------------------ // Replace with KOIVI Editor $t_area = new XoopsFormWysiwygTextArea( _TC2_CONTENT, 'message', '' , '100%', '400px', ''); $t_area->setUrl("/class/wysiwyg"); $form->addElement( $t_area ); // ------------------------------------------------------------------------ } else { $t_area = new XoopsFormDhtmlTextArea(_TC2_CONTENT, 'message', '', 37, 35); $form->addElement($t_area); } [/code] and for the "edit" case I have [code] if ($xoopsModuleConfig['xt_wysiwyg'] == '1') { echo 'case[edit] :: xoopsModuleConfig>>xt_wysiwyg [1]'; /* // SPAW Config $spaw_root = XOOPS_ROOT_PATH.'/modules/xt_conteudo/admin/spaw/'; include $spaw_root.'spaw_control.class.php'; if (checkBrowser()) { ob_start(); $sw = new SPAW_Wysiwyg('message',$message); $sw->show(); $form->addElement(new XoopsFormLabel(_TC2_CONTENT, ob_get_contents())); ob_end_clean(); } else { $t_area = new XoopsFormDhtmlTextArea(_TC2_CONTENT, 'message', $message, 37, 35); $form->addElement($t_area); } */ // ------------------------------------------------------------------------ // Replace with KOIVI Editor $t_area = new XoopsFormWysiwygTextArea( _TC2_CONTENT, 'message', $message , '100%', '400px', ''); $t_area->setUrl("/class/wysiwyg"); $form->addElement( $t_area ); // ------------------------------------------------------------------------ } else { $t_area = new XoopsFormDhtmlTextArea(_TC2_CONTENT, 'message', $message, 37, 35); $form->addElement($t_area); } [/code] My debugging version of KOIVI WYSIWYG code contains the following - In formwysiwygtextarea.php, the beginning of the render() function looks like this: [code] function render() { echo 'XoopsFormWysiwygTextArea>>render()'; //include files include_once 'include/functions.inc.php'; include_once getLanguage($this->getUrl()); global $koivi_editor_instances; echo 'koivi_instances:='.$koivi_editor_instances; $width=$this->getWidth(); $height=$this->getHeight(); [/code] In functions.inc.php, the three functions begin like this: [code] // URL: http://www.myweb.ne.jp/, https://xoops.org/, http://www.xoopscube.jp/ // // Project: The XOOPS Project // // ------------------------------------------------------------------------- // echo 'trace :: 1'; function getMainfile($url) { echo "getMainfile() :: $url"; $mpath=''; for ($i=0;$i>xt_wysiwyg [1] XoopsFormWysiwygTextArea>>render() trace :: 1 trace :: 2 trace :: 3 $_SERVER['HTTP_USER_AGENT'] -------- Tracing occurs in the include file, but the editor form does not render. Using the double-quoted string, the output is -------- case[submit] :: xoopsModuleConfig>>xt_wysiwyg [1] XoopsFormWysiwygTextArea>>render() getLanguage() :: /class/wysiwyg koivi_instances:=1 -------- No tracing in the include file, but the editor form renders and is functional. What seems to force the rendering of the editor almost looks like a PHP bug, or perhaps it's actually in the render() function itself, because these statements work echo '<br>'.$_SERVER[\'HTTP_USER_AGENT\']; echo "<br>$_SERVER[\'HTTP_USER_AGENT\']"; echo "<br>$_SERVER['HTTP_USER_AGENT']"; but these do not echo '<br>'.$_SERVER['HTTP_USER_AGENT']; echo '<br>'.$_SERVER; So, I can force rendering by putting in a certain kind of server variable evaluation statement after the getLanguage() function, and outside the function boundaries in open PHP code. Putting it any place before that in the file does not work. But this is a serious hack. Does anyone see what is really going on here, and how it should be fixed?[/quote]" />

Re:help with koivi
by samuels on 2004/11/15 21:24:23

I don't care about using single or double quotes, perhaps is something related on php config "magic_quotes".
Re:help with koivi
by dejadingo on 2004/11/15 16:34:01

Thanks a lot. This works. But now I'm more confused ...

The difference is that I put the include_once for the XoopsFormWysiwygTextArea class (formwysiwygtextarea.php) in admin_header.php thinking that since it should only be included once, it would be good to put it in the header file. Here is my include:

le="color: #000000"><?php // Project: The XOOPS Project // // ------------------------------------------------------------------------- // include_once "../../../mainfile.php"; include_once XOOPS_ROOT_PATH."/class/xoopsmodule.php"; include_once XOOPS_ROOT_PATH."/include/cp_functions.php"; include_once XOOPS_ROOT_PATH."/include/xoopscodes.php"; include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; // ------------------------------------------------------------------------- // KOIVI WYSIWYG Class include_once XOOPS_ROOT_PATH.'/class/wysiwyg/formwysiwygtextarea.php'; // ------------------------------------------------------------------------- include '../../../include/cp_header.php';


Note that I copied/edited the last original include_once line, the one for xoopsformloader.php -- which happened to use single-quotes.

Since I couldn't believe that one "include_once" in a header should work differently from two "include_once" statements in index.php, I tried changing the single-quotes in the header file to double-quotes (since your include used a double-quoted string), and [...drum roll...] that makes it work!

Is there some special rule about when you can/can't use single quotes in PHP? I always thought they were basically interchangable?

Anyway, thanks again for this very nice editor. It's going to make the sites I manage much more friendly to their owners.
Re:help with koivi
by samuels on 2004/11/13 11:15:31

I've downloaded it but I dont have any problem with it.

This is the admin/index.php file I've modified.

http://www.forjandoleyendas.com/public/fl/uploads/xt_conteudo_koivi_index.zip
Re:help with koivi
by dejadingo on 2004/11/12 20:06:48

@Samuels
Have you been able to download xt-conteudo?
And are you using something special to debug this?

I installed php-dbg and PHP Coder, but even though I occasionally get a warning trace on some of my pages, I can't seem to get the debugger to stop at the breakpoints I have set.

Thanks.
Re:help with koivi
by astuni on 2004/11/9 12:08:29

Quote:

WarDick wrote:
Hi Samuels,

First let me say thank you for such a great implementation. I have just installed it into my news module and all works well except for the problem described above. I can not insert an image though the image manager. I followed your advice.

Quote:
For imagemanager you must change the imagemanager template with the one I've included on the package.

The second problem is because I had an error overriding a method.It will be fixed on new version.


Buf I still can not insert an image. It works great with the insert image button.

I guess the next item is a request rather than a bug report. To make the preview work with the theme style sheet. Such as image padding, margins and etc.


be sure to update the system module after replacing the template


@Samuels: Thanx so much!

Who's Online

877 user(s) are online (782 user(s) are browsing Support Forums)


Members: 0


Guests: 877


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits