61
dejadingo
Re:help with koivi
  • 2004/11/15 16:34

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


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:

// 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.



62
dejadingo
Re:[Tinyevent] block anonymous users from submitting events
  • 2004/11/12 22:10

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


But $xoopsUser is not defined at this point.
I can't find exactly where it is defined, and I'm not sure if this is a good place to make it available.

Can this be pulled out separately as a block (or something)and still make it be subordinate to the main tinycontent menu item?

Thanks for your help.



63
dejadingo
Re:help with koivi
  • 2004/11/12 20:06

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


@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.



64
dejadingo
Re:help with koivi
  • 2004/11/8 1:31

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


The xt-conteudo module can be found
here. Sorry, I forgot the module is spelled in Spanish.

It's based on TinyContent, and I'll probably end up cloning it so I can use it in the same way as TinyD.

My requirements are a bit non-standard since my sites are not really information portals. I need to maintain strict control over the site structure and presentation, but allow my site owners (who are very much non-technical) access to their content. There won't be registered users in the normal sense, but site owners will have customized restricted administrative access to the site. Several have MAC computers, and I'm very pleased to be able to use your KOIVI editor. Now if we can only convince Gecko and Safari to implement the missing functionality on their end, my people won't always need to use IE ...



65
dejadingo
Re:help with koivi
  • 2004/11/7 6:59

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


I've been trying to do the same thing with the xt-content module, following the doc instructions and getting a blank form (not a blank page) when the editor is included.

Win2K SP4
Apache 1.3.29
MySQL 4.0.18
PHP 4.3.4

Sorry for the length of this post, but it's the result of some serious debugging. I started putting in echo statements in the code because even with PHP debugging turned on there are no debugging traces, and isolated it to the location in formwysiwygtextarea.php in the render() function where it includes functions.inc.php. I got it to render the editor form by accident and after much experimentation I do not understand what is going on here.

Here's my conversion of xt-content from SPAW to KOIVI -

1) in admin_header.php, after
include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';

I added
// -------------------------------------------------------------------------
// KOIVI WYSIWYG Class
include_once XOOPS_ROOT_PATH.'/class/wysiwyg/formwysiwygtextarea.php';
// -------------------------------------------------------------------------


2) in index.php
for the "submit" case I have
if ($xoopsModuleConfig['xt_wysiwyg'] == '1') {
        echo 
'<br>case[submit] :: 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', '', 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'''3735);
        
$form->addElement($t_area);
    }


and for the "edit" case I have
if ($xoopsModuleConfig['xt_wysiwyg'] == '1') {
        echo 
'<br>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'$message3735);
        
$form->addElement($t_area);
    }


My debugging version of KOIVI WYSIWYG code contains the following -

In formwysiwygtextarea.php, the beginning of the render() function looks like this:
function render()
    {
        echo 
'<br>XoopsFormWysiwygTextArea>>render()';
        
//include files
        
include_once 'include/functions.inc.php';
        include_once 
getLanguage($this->getUrl());
        global 
$koivi_editor_instances;

        echo 
'<br>koivi_instances:='.$koivi_editor_instances;

       
$width=$this->getWidth();
        
$height=$this->getHeight();


In functions.inc.php, the three functions begin like this:
// URL: http://www.myweb.ne.jp/, https://xoops.org/, http://www.xoopscube.jp/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //

echo '<br>trace :: 1';

function 
getMainfile($url)
{
    echo 
"<br>getMainfile() :: $url";
    
$mpath='';
    for (
$i=0;$i<strlen($url);$i++)
    {
        if (
$url[$i]=='/')$mpath.='../';
    }
    return 
$mpath.'mainfile.php';
}

echo 
'<br>trace :: 2';

function 
getLanguage($url)
{
    echo 
"<br>getLanguage() :: $url";
    global 
$xoopsConfig;
    if(
file_exists(XOOPS_ROOT_PATH.''.$url.'/language/'.$xoopsConfig['language'].'/lang.php'))
    return 
''.XOOPS_ROOT_PATH.''.$url.'/language/'.$xoopsConfig['language'].'/lang.php';
    else return 
''.XOOPS_ROOT_PATH.''.$url.'/language/english/lang.php';
}

echo 
'<br>trace :: 3';
echo 
'<br>$_SERVER['HTTP_USER_AGENT']';

function 
CheckBrowser($get_isie=true)
{
    echo 
"<br>CheckBrowser() :: $get_isie";
    global 
$_SERVER;

        
$comp=false;
        
$isie=false;


Note particularly the echo traces both inside and between the functions.
Now for the confusing part...

When I change the echo for the User Agent to use double-quotes

echo "<br>$_SERVER[\'HTTP_USER_AGENT\']";

(with or without the escape on the single-quotes) it changes the behavior of the system.

Using a single-quoted string, the output is
--------
case[submit] :: xoopsModuleConfig>>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?



66
dejadingo
Re:Suggestions and pointers please
  • 2004/10/23 3:50

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


Quote:

For information about module development, I recommend hopping over to the XoopsForge (dev.xoops.org) site. There is a strong development community at this site, as well as module development resources.

Thanks.
Looks like the No-Ah stuff might be exactly what I need.



67
dejadingo
Re: Suggestions and pointers please
  • 2004/10/22 14:19

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


Can't seem to edit my own post, but I've answered my own question #4.
[interesting ... I can edit this one (same session?) but not the original]
Thanks.



68
dejadingo
Suggestions and pointers please
  • 2004/10/22 4:25

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


I've been researching XOOPS for several weeks now, and I have to say I haven't been this excited about something since I started using Smalltalk. I think I've learned enough to start asking some questions.

First, my reasons for wanting to use XOOPS are perhaps a little different. I manage the sites for some non-profit orgs I belong to, and I need to allow some absolute non-techies to edit their own content while maintaining strict control over the structure and the graphical presentation of the site.

Now the questions:

1) Can someone please discuss the intersection of templates and blocks?

I totally get the OO stuff, and the difference between templates and themes is clear, but is there some non-trivial usage of templates I can look at to understand when I should build a template and when I should build a block? For example, I have one page that I need to convert, which has some static text at the top and then what should be converted to a table built from database entries. So is that a block or a template and a block, or what?

2) Is there somewhere out there a detailed discussion of how to build a module?

I need a very simple event list: date/time/location/presenter/phone, and I'm thinking I could probably modify TinyEvent to do what I need, but I would feel more comfortable with more detailed instructions. Database and SQL do not bother me, but I don't yet see the big picture and what pieces go where.

3) I want to use TinyContent, and I have the base module working, but I can't figure out how to enable the numbered clones.

4) I'm planning to use MultiMenu (for its TreeView presentation) but I can't seem to get the menu items hooked up to the TinyContent pages.

5) Can someone please jump the gun and tell me how to replace the SPAW editor in TinyContent with the new Koivi editor. Some of my non-techie people have Macs and this thing looks great.

This should be enough to get me going.
And thanks so much for the strong Community. It's been a joy to step into something with the base functionality already pre-constucted.




TopTop
« 1 ... 4 5 6 (7)



Login

Who's Online

153 user(s) are online (92 user(s) are browsing Support Forums)


Members: 0


Guests: 153


more...

Donat-O-Meter

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

Latest GitHub Commits